PHP_Chapter03_ReviewQuestions

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

____	1.	All text strings must begin and end with double quotation marks.

____	2.	The concatenation operator (.) combines several string variables and literal strings and assigns the new value to another variable.

____	3.	The concatenation assignment operator (.=) combines two text strings.

____	4.	An escape character tells the compiler or interpreter to exit the program at the escape character.

____	5.	Placing a backslash in front of an apostrophe tells the PHP scripting engine that the apostrophe is to be treated as a regular keyboard character.

____	6.	The escape character combined with one or more other characters is called an escape sequence.

____	7.	The escape sequence \\ inserts a comment.

____	8.	The escape sequence to insert a carriage return is \r.

____	9.	To insert a horizontal tab, use the escape sequence \t.

____	10.	The function substr_count() returns the total number of characters in a string.

____	11.	The str_word_count() function returns the number of digits in a string.

____	12.	The term parsing refers to the act of dividing a string into logical component substrings or tokens.

____	13.	The strpos() function performs a case-sensitive search for specified characters in a string and returns the position of the first occurrence of a substring within a string.

____	14.	The strchr() function or strrchr() function return a substring from the specified characters to the end of the string.

____	15.	The strtok() function breaks a program into functions.

____	16.	The syntax for the strtok() function is $variable=strtok(string, separators);

____	17.	The explode() function splits a string into an indexed array at a specified separator.

____	18.	The opposite of the explode() function is the implode() function.

____	19.	ASCII stands for American Standard Code for Internet Information.

____	20.	The strcasecmp() function and the strcmp() function respectively perform a case-insensitive and case-sensitive comparison of strings.

____	21.	The levenshtein() function returns the number of characters you need to change for two strings to be the same.

____	22.	The soundex() function returns a value representing a name’s phonetic equivalent.

____	23.	A megaphone is an algorithm that returns a code for indexing words by their sound, when pronounced in English

____	24.	Regular expressions are patterns that are used for matching and manipulating strings according to specified rules.

____	25.	PHP support Perl Compatible Regular Expressions (PCRE).

____	26.	Regular expression patterns are enclosed in opening and closing delimiters.

____	27.	The metacharacter (.) matches any single character.

____	28.	The metacharacter (^) anchors characters to the end of a string.

____	29.	An anchor specifies that a pattern must appear at that position in the string.

____	30.	Metacharacters that specify the quantity of a match qualifiers.

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

____	31.	The concatenation operator in PHP is a ____.
a.	plus sign (+)	c.	minus sign (-)	
b.	period (.)	d.	question mark (?)	

____	32.	In PHP, the escape character is the ____.
a.	pipe (|)	c.	semicolon(;)	
b.	period (.)	d.	backslash(\)	

____	33.	The escape character sequence ____ inserts a new line.
a.	\l	c.	\n	
b.	\CR	d.	\nl	

____	34.	The escape sequence \\ inserts a(n) ____.
a.	comment	c.	backslash	
b.	web ink	d.	directory	

____	35.	The escape sequence to insert a carriage return is ____.
a.	\r	c.	\t	
b.	\cr	d.	\\	

____	36.	A structure in which variables are placed within curly braces inside of a string is called a ____.
a.	complex string syntax	c.	function	
b.	simple string syntax	d.	method	

____	37.	The strlen() function returns the total ____ in a string.
a.	number of numerals	c.	number of occurrences	
b.	number of characters	d.	number of words	

____	38.	The most commonly used string counting function is the ____ function, which returns the total number of characters in a string.
a.	str_count()	c.	strpos()	
b.	strlen()	d.	total()	

____	39.	The ____ function converts all of the letters in a string to capital letters.
a.	strtoupper()	c.	strtolower()	
b.	stringtoupper()	d.	stringtolower()	

____	40.	The ____ function converts any occurrence of (&), ("), ('), (<), and (>) to their equivalent HTML character entity.
a.	converttohtml()	c.	htmlspecialchars()	
b.	specialhtml()	d.	convertchars()	

____	41.	The ____ function uses a strong encryption algorithm called Message-Digest Algorithm to create a one-way hash of an entered string.
a.	strhash()	c.	mda()	
b.	str-ireplace()	d.	md5()	

____	42.	The ____ function will remove both leading and trailing spaces from a string.
a.	ltrim()	c.	trim()	
b.	rtrm()	d.	strtrim()	

____	43.	The ____ function randomly scrambles the order of characters in a string.
a.	str_scramble()	c.	str_jumble()	
b.	str_shuffle()	d.	str_random()	

____	44.	The ____ function splits a string into an indexed array.
a.	repair()	c.	explode()	
b.	implode()	d.	strtok()	

____	45.	ASCII values range from ____.
a.	0 to 512	c.	1 - 26	
b.	0 to 255	d.	1 - 128	

____	46.	The strcmp() function performs a ____ comparison of two strings.
a.	case-insensitive	c.	case-sensitive	
b.	standard	d.	sub-standard	

____	47.	The similar_text() function returns the number of ____ to strings have in common.
a.	characters	c.	numbers	
b.	words	d.	sounds	

____	48.	____ are special characters that define the pattern matching rules in a regular expression.
a.	Specialchars	c.	Expressionchars	
b.	Patterncharacters	d.	Metacharacters	

____	49.	In a regular expression, a(n) ____ specifies that the pattern must appear at that position in the string.
a.	pointer	c.	position	
b.	anchor	d.	spotter	

____	50.	The  metacharacter, ____, specifies an anchor at the end of the line.
a.	(\)	c.	(^)	
b.	(&)	d.	($)	

____	51.	The ____ quantifier specifies that zero or more of the preceding characters can match.
a.	(&)	c.	(#)	
b.	(*)	d.	(?)	

____	52.	____ quantifiers allow you to more precisely specify the number of times a character must repeat sequentially.

a.	Curly brace	c.	Parentheses	
b.	Curly bracket	d.	Double quotation marks	

____	53.	The characters contained in a set of parentheses within a regular expression are referred as a ____.
a.	subpattern	c.	nested pattern	
b.	basepattern	d.	base expression	

____	54.	The ____ metacharacter is used to specify a range of values in a character class.
a.	(-)	c.	(@)	
b.	(+)	d.	(‘)	

____	55.	The ____ metacharacter is used to allow a string to contain an alternate set of substrings.
a.	(!)	c.	(\)	
b.	(|)	d.	(/)	

PHP_Chapter03_ReviewQuestions
Answer Section

TRUE/FALSE

	1.	REF:	125

	2.	REF:	126

	3.	REF:	127

	4.	REF:	128

	5.	REF:	128

	6.	REF:	128

	7.	REF:	129

	8.	REF:	129

	9.	REF:	129

	10.	REF:	134

	11.	REF:	134

	12.	REF:	141

	13.	REF:	142

	14.	REF:	142

	15.	REF:	147

	16.	REF:	147-148

	17.	REF:	151

	18.	REF:	152

	19.	REF:	154

	20.	REF:	156

	21.	REF:	158

	22.	REF:	159

	23.	REF:	159

	24.	REF:	160

	25.	REF:	160

	26.	REF:	161

	27.	REF:	162

	28.	REF:	162

	29.	REF:	163

	30.	REF:	164

MULTIPLE CHOICE

	31.	REF:	126

	32.	REF:	128

	33.	REF:	129

	34.	REF:	129

	35.	REF:	129

	36.	REF:	132

	37.	REF:	134

	38.	REF:	134

	39.	REF:	135

	40.	REF:	138

	41.	REF:	138

	42.	REF:	139

	43.	REF:	140

	44.	REF:	151

	45.	REF:	154

	46.	REF:	156

	47.	REF:	158

	48.	REF:	162

	49.	REF:	163

	50.	REF:	163

	51.	REF:	164

	52.	REF:	165

	53.	REF:	165

	54.	REF:	166

	55.	REF:	169