Define the term “embedded language” as it applies to PHP.
|
embedded language is when there are two differernt types of code --- example html and php --- one set of code is embedded inside another
|
Why should you avoid using the .php extension if the document contains only XHTML code?
|
Because it it does not contain any php to be run and the interperator will still run and interporate the file
|
Explain why you do not see any PHP code when you view the source code of a PHP page in the browser
|
because the php code went through the interpretor on the webserver which interpreted it and did what it said which doesn't include sending code back it only includes sending the html content
|
What are PHP Code blocks?
|
PHP code blocks are the chunks of code that are embedded inside the html.
|
What are standard PHP script delimiters?
|
Standard script delimiters are the PHP code block declarations used most often and look like this: ?PHP … ?
|
What is the script element?
|
script is an HTML element than can be used to begin and end a php code block
|
What are short PHP script delimiters?
|
Short delimiters just shorten ?PHP … ? to ? … ?
|
What are ASP-style script delimiters?
|
ASP style delimiters are: % … %
|
What are functions?
|
Functions are reusable chunks of code we write to better organize our programs.
|
how do I display results?
To display results we use echo and print statements.
How do I display multiple code blocks?
I display multiple code blocks by beginning and ending blocks as we go through the code.
How many code declaration blocks can be inserted in a PHP document?
As far as the coding langauge is concerned unlimited but that limit really is the amount of memory your computer allows
Why does the PHP Group recommend that you use standard PHP script delimiters to write PHP code declaration blocks?
It is the industry standart and everyone knows it and the web browser will know the standart forms.
What character or characters are used as delimiters to separate multiple arguments (parameters) in a function declaration or function call?
comma ,
Describe the type of information that the phpinfo() function generates.
Environmental information about php on the current webserver
Identify the two types of comments available in PHP and indicate when each would be used.
1.Single line //
2. Multiline /* */
what are variables?
A variable are values a program stores / Techincally a specific location in a computer's memory.
Describe the two-step process of making a variable available
for use in the PHP script.
I must Declare or initialize it THEN set it to a value.
Explain the syntax for displaying a variable or variables in the
PHP script using the echo or print statements.
you need to use " " for strings and then concatenator operatpr "." to append the variable $myvariable = 'this string is" $othervar. ":";
How do you make a constant name case insensitive?
use the declare function with booean true as third argument
what is a data type?
Different types of data that a variable can contain and they are Defined by how much memory it takes up and the structure of the data is there.
What is the difference between a strongly typed and loosely typed programming language?
In loosely typed we don't have to declare the data type the programming language will work it out and in strongly we typed we have to declare the data type.
What is static typing and what is dynamic typing?
Programming languages that do not require you to declare the data types of variables are called loosely typed programming languages and Loose typing is also known as dynamic typing because the data type for a variable can change after it has been declared.
Is PHP Strongly typed or loosely typed?
Php is a Loosely typed language
What is a Boolean?
A Boolean value is a value of “true” or “false”
How much memory does a BOOLEAN value takes up in memory?
A Boolean is a byte
What symbol is used to divide the left operand by the right operand and return the remainder?
% (modulus or modulo)
2 % 4 = 0
2 % 5 = 1
2 % 6 = 0
2 % 35,689 = 1
Explain the difference between an assignment operator and a compound assignment operator.
Assignment operator assigns the right thing to the left
$myvar = 6; this assigns the value 6 to the $myvar variable
Compound assignment operator assigns the value arrived by the operator to the thing on the left.
$myvar +=; this is equal to $myvar = $myvar + 6
Explain the difference between a prefix operator and a postfix operator.
prefix does the operation before and postfix does it after
$myvar =2;
++$myvar;
$myvar = $myvar + ++$myvar;
$myvar = $myvar + $myvar++
what is a Function?
groups of statements that you can execute as a single unit
Explain the two-step process of creating user-defined functions in a PHP script.
1. Define the function
2. Writing the body.
Describe the purpose of the return statement in a function.
Returns information when the function is done.
Explain why some functions do not need parameters.
Because they perform operations on data outside the function and do not need data to perform the operations.
Explain why some functions do not have a return statement.
They don't need a return value.
Explain the difference between passing a parameter to a function by value versus by reference.
Function by value takes the value and creates a NEW local variable to the function with the parameters value. Value by reference passes in a reference to the memory location where the variable is held.
what are styles?
1. A style is a html markup way to structure our document.
2. Styles are a method to present documents
What is a passing parameter?
A passing parameter is a value or parameter that moves or changes in a function these work by either setting the value which will create a local copy in the program
or by reference which instead of saving a local copy the variable will actual become a part of the function.
Define the term variable scope
A variable scope is where the variable can be seen
Explain the difference between a local variable and a global variable.
Local can only be seen between the {} and global can be seen everywhere
A variable declared outside of a function must be declared to be available within the function by using which keyword?
Use the global keyword inside the function