TRUE/FALSE
1. All Web pages containing PHP code must have an extension of .php.
ANS: T PTS: 1 REF: 2
2. The source code for PHP can be viewed in the client browser.
ANS: F PTS: 1 REF: 2
3. It is a good practice to name all Web files with a .php extension even if they contain no PHP
code.
ANS: F PTS: 1 REF: 3
4. In PHP, you are limited to ten (10) code blocks in a single page.
ANS: F PTS: 1 REF: 3
5. Using the standard method of writing PHP blocks, the <?php and ?> are used to begin and
end a code block.
ANS: T PTS: 1 REF: 3
6. The primary purpose of a semicolon in PHP is to identify the end of a line.
ANS: F PTS: 1 REF: 4
, 7. In PHP, each statement must be placed on a separate line.
ANS: F PTS: 1 REF: 4
8. When using the <script> element, a value of “php” must be assigned to the type attribute.
ANS: F PTS: 1 REF: 6
9. When using multiple arguments in a function, you must separate the arguments with a comma.
ANS: T PTS: 1 REF: 11
10. Both the echo and print statements return a value of 1 if successful and 0 if not successful.
ANS: F PTS: 1 REF: 13
11. A text string can be contained in either double or single quotation marks.
ANS: T PTS: 1 REF: 14
12. A line comment must be placed at the end of the line to which the comment refers.
ANS: F PTS: 1 REF: 21
13. $_ABC1 is a valid variable identifier.
ANS: F PTS: 1 REF: 23
,14. In PHP, you can declare a variable without assigning a value to it.
ANS: F PTS: 1 REF: 23
15. When you pass a variable name to the echo statement, you must enclose the variable name in
double quotation marks.
ANS: F PTS: 1 REF: 24
16. If you use a variable name in a text string enclosed by single quotation marks, the name of the
variable will display.
ANS: T PTS: 1 REF: 25
17. Constant names, like variable names, must begin with a $.
ANS: F PTS: 1 REF: 28
18. Constant names are always case sensitive.
ANS: F PTS: 1 REF: 28
19. Data types that can be assigned only a single value are called primitive types.
ANS: T PTS: 1 REF: 30
20. When you assign a NULL value to a variable, you ensure that the variable does not contain any
data.
ANS: T PTS: 1 REF: 30
, 21. Arrays and objects are examples of the primitive data type.
ANS: F PTS: 1 REF: 30
22. In PHP programming, you can only use TRUE or FALSE to indicate Boolean values.
ANS: T PTS: 1 REF: 33
23. Array names are often referred to with the array operators [ and ] at the end of the name to
clearly define them as arrays.
ANS: T PTS: 1 REF: 33
24. The numbering of elements within an array starts with an index number of one (1).
ANS: F PTS: 1 REF: 34
25. The values assigned to different array elements of the same array can be of different data types.
ANS: T PTS: 1 REF: 36
26. A unary operator requires an operand before or after the operator.
ANS: T PTS: 1 REF: 41
27. The modulus operator returns the remainder left from the division of two integers.
ANS: T PTS: 1 REF: 41