0% found this document useful (0 votes)
32 views1 page

MidtermExam Coverage

A PHP script is executed on the server and sends plain HTML to the browser. Variables can have global or local scope depending on whether they are declared outside or inside a function. PHP stores global variables in the $GLOBALS array which can be accessed within functions. Functions allow passing information through arguments and comments do not execute but are for human readers.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views1 page

MidtermExam Coverage

A PHP script is executed on the server and sends plain HTML to the browser. Variables can have global or local scope depending on whether they are declared outside or inside a function. PHP stores global variables in the $GLOBALS array which can be accessed within functions. Functions allow passing information through arguments and comments do not execute but are for human readers.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

1. A PHP script is executed on the server, and the plain HTML result is sent back to the browser.

2. The scope of a variable is the part of the script where the variable can be referenced/used.
3. A variable declared outside a function has a GLOBAL SCOPE and can only be accessed outside
a function
4. PHP also stores all global variables in an array called $GLOBALS[index]. The index holds the
name of the variable. This array is also accessible from within functions and can be used to
update global variables directly.
5. echo and print are more or less the same. They are both used to output data to the screen.
6. The differences are small: echo has no return value while print has a return value of 1 so it can be
used in expressions. echo can take multiple parameters (although such usage is rare)
while print can take one argument. echo is marginally faster than print.
7. An integer data type is a non-decimal number between -2,147,483,648 and 2,147,483,647.
8. A float (floating point number) is a number with a decimal point or a number in exponential
form.
9. A Boolean represents two possible states: TRUE or FALSE.
10. The PHP arithmetic operators are used with numeric values to perform common arithmetical
operations, such as addition, subtraction, multiplication etc.
11. The PHP comparison operators are used to compare two values (number or string):
12. The PHP decrement operators are used to decrement a variable's value.
13. Arguments are specified after the function name, inside the parentheses.
14. A multidimensional array is an array containing one or more arrays.
15. Variables are "containers" for storing information.
16. The PHP logical operators are used to combine conditional statements.
17. PHP has two operators that are specially designed for strings.
18. The PHP array operators are used to compare arrays.
19. A user-defined function declaration starts with the word function:
20. Information can be passed to functions through arguments. An argument is just like a variable.
21. A comment in PHP code is a line that is not executed as a part of the program. Its only purpose is
to be read by someone who is looking at the code.
22. A variable declared within a function has a LOCAL SCOPE and can only be accessed within that
function
23. A string is a sequence of characters, like "Hello world!".
24. An array stores multiple values in one single variable.
25. Operators are used to perform operations on variables and values.
26. The PHP assignment operators are used with numeric values to write a value to a variable.
27. The PHP increment operators are used to increment a variable's value.
28. The PHP conditional assignment operators are used to set a value depending on conditions:
29. The global keyword is used to access a global variable from within a function.
30. A class is a template for objects, and an object is an instance of a class.
31. A constant is an identifier (name) for a simple value. The value cannot be changed during the
script.
32. Associative arrays are arrays that use named keys that you assign to them.

You might also like