PHP_Chapter1_ReviewQuestions

True/False
Indicate whether the statement is true or false.

____	1.	All Web pages containing PHP code must have an extension of .php.

____	2.	The source code for PHP can be viewed in the client browser.

____	3.	It is a good practice to name all Web files with a .php extension even if they contain no PHP code.

____	4.	In PHP, you are limited to ten (10) code blocks in a single page.

____	5.	Using the standard method of writing PHP blocks, the <?php and ?> are used to begin and end a code block.

____	6.	The primary purpose of a semicolon in PHP is to identify the end of a line.

____	7.	In PHP, each statement must be placed on a separate line.

____	8.	When using the <script> element, a value of “php” must be assigned to the type attribute.

____	9.	When using multiple arguments in a function, you must separate the arguments with a comma.

____	10.	Both the echo and print statements return a value of 1 if successful and 0 if not successful.

____	11.	A text string can be contained in either double or single quotation marks.

____	12.	A line comment must be placed at the end of the line to which the comment refers.

____	13.	$_ABC1 is a valid variable identifier.

____	14.	In PHP, you can declare a variable without assigning a value to it.

____	15.	When you pass a variable name to the echo statement, you must enclose the variable name in double quotation marks.

____	16.	If you use a variable name in a text string enclosed by single quotation marks, the name of the variable will display.

____	17.	Constant names, like variable names, must begin with a $.

____	18.	Constant names are always case sensitive.

____	19.	Data types that can be assigned only a single value are called primitive types.

____	20.	When you assign a NULL value to a variable, you ensure that the variable does not contain any data.

____	21.	Arrays and objects are examples of the primitive data type.

____	22.	In PHP programming, you can only use TRUE or FALSE to indicate Boolean values.

____	23.	Array names are often referred to with the array operators [ and ] at the end of the name to clearly define them as arrays.

____	24.	The numbering of elements within an array starts with an index number of one (1).

____	25.	The values assigned to different array elements of the same array can be of different data types.

____	26.	A unary operator requires an operand before or after the operator.

____	27.	The modulus operator returns the remainder left from the division of two integers.

____	28.	A comparison operator returns a Boolean value of TRUE or FALSE after two operands have been compared.

____	29.	Type casting, changes the data type of a variable from one data type to another.

____	30.	You can use parentheses with expressions to change the associativity in which individual operations in an expression are evaluated.

Multiple Choice
Identify the choice that best completes the statement or answers the question.

____	31.	The PHP Group recommends you use the standard ____ script delimiters to write PHP code declaration blocks.
a.	<? statements ?>	
b.	<?php statements ?>	
c.	<script language = "php">statements</script>	

____	32.	____ are lines you place in your code that do not get executed but provide helpful information such as the name of the script, your name and the date your created the program.
a.	Pointers	c.	Comments	
b.	Instructions	

____	33.	____ a variable is the processing of assigning a first value to a variable. 
a.	Initializing	c.	Finalizing	
b.	Declaring	

____	34.	The ____ function is used to create a constant.
a.	create()	c.	describe()	
b.	define()	

____	35.	The ____ type is the specific category of information that a variable contains.
a.	variable	c.	content	
b.	data	

____	36.	Data types that can be assigned only a single value are called ____ types.
a.	individual	c.	primitive	
b.	mono	

____	37.	In a ____ programming language the data type for a variable will not change after it has been declared.
a.	loosely typed	c.	constantly typed	
b.	strongly typed	

____	38.	____ are positive and negative numbers and 0 with no decimal places.
a.	Integers	c.	Digits	
b.	Numbers	

____	39.	Exponential ____ is a shortened format for writing very large numbers with any decimal places.
a.	numbering	c.	registering	
b.	notation	

____	40.	A(n) ____ is an element’s numeric position within an array.
a.	location	c.	indicator	
b.	index	

____	41.	You use the ____ function to find the total number of elements in an array.
a.	sum()	c.	count()	
b.	counta()	

____	42.	The print_r(), var_export(), and var_dump()functions are used with ____ to display the index and value of each element.
a.	variables	c.	arrays	
b.	functions	

____	43.	A(n) ____ is a literal value or variable that can be evaluated by the PHP scripting engine to produce a result.
a.	expression	c.	clause	
b.	condition	

____	44.	____ are symbols, such as the (+) symbol that are used in expressions to manipulate operands.
a.	Literals	c.	Expressions	
b.	Operators	

____	45.	A(n) ____ operator requires a single operand either before or after the operator.
a.	unary	c.	binary	
b.	single	

____	46.	A(n) ____ operator is used in PHP to perform mathematical calculations.
a.	math	c.	calculation	
b.	arithmetic	

____	47.	The ____ operator uses the % symbol to find the remainder of integer division.
a.	division	c.	arithmetic	
b.	modulus	

____	48.	Assignment operators are used to assign a ____ to a variable.
a.	name	c.	data type	
b.	value	

____	49.	____ assignment operators perform mathematical calculations on variables and literal values in an expression and then assign a new value to the left operand.
a.	Compound	c.	Binary	
b.	Complex	

____	50.	The ____ operation uses the === (triple equal sign) to compare two operands for equality and data type.
a.	equal	c.	comparison	
b.	strict equal	

____	51.	The ____ operator executes one of two expressions based on the results of a conditional expression.
a.	conditional	c.	comparison	
b.	expressional	

____	52.	Logical operators are used for comparing two ____ operands for equality.
a.	numeric	c.	string	
b.	Boolean	

____	53.	The ____ symbol is used to suppress any errors that might be generated by an expression to which it is prepended.
a.	#	c.	@	
b.	=>	

____	54.	One way to ensure that a variable is of the correct data type is through type ____.
a.	naming	c.	casting	
b.	identifying	

____	55.	The ____ function tests whether a variable contains a numeric data type.
a.	is_number()	c.	is_numeric()	
b.	is_digit()	

PHP_Chapter1_ReviewQuestions
Answer Section

TRUE/FALSE

	1.	REF:	2

	2.	REF:	2

	3.	REF:	3

	4.	REF:	3

	5.	REF:	3

	6.	REF:	4

	7.	REF:	4

	8.	REF:	6

	9.	REF:	11

	10.	REF:	13

	11.	REF:	14

	12.	REF:	21

	13.	REF:	23

	14.	REF:	23

	15.	REF:	24

	16.	REF:	25

	17.	REF:	28

	18.	REF:	28

	19.	REF:	30

	20.	REF:	30

	21.	REF:	30

	22.	REF:	33

	23.	REF:	33

	24.	REF:	34

	25.	REF:	36

	26.	REF:	41

	27.	REF:	41

	28.	REF:	51

	29.	REF:	59

	30.	REF:	63

MULTIPLE CHOICE

	31.	REF:	4

	32.	REF:	20

	33.	REF:	23

	34.	REF:	28

	35.	REF:	30

	36.	REF:	30

	37.	REF:	31

	38.	REF:	31

	39.	REF:	31

	40.	REF:	34

	41.	REF:	36

	42.	REF:	38

	43.	REF:	40

	44.	REF:	40-41

	45.	REF:	41

	46.	REF:	41

	47.	REF:	43

	48.	REF:	41

	49.	REF:	48

	50.	REF:	51

	51.	REF:	52

	52.	REF:	55

	53.	REF:	58

	54.	REF:	59

	55.	REF:	60