Deck 3: Manipulating Strings

Full screen (f)
exit full mode
Question
An escape character tells the compiler or interpreter to exit the program at the escape character.
Use Space or
up arrow
down arrow
to flip the card.
Question
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.
Question
The opposite of the explode() function is the implode() function.
Question
The escape sequence to insert a carriage return is \r.
Question
The strchr() function or strrchr() function return a substring from the specified characters to the end of the string.
Question
The concatenation operator (.) combines several string variables and literal strings and assigns the new value to another variable.
Question
ASCII stands for American Standard Code for Internet Information.
Question
The strtok() function breaks a program into functions.
Question
To insert a horizontal tab, use the escape sequence \t.
Question
The term parsing refers to the act of dividing a string into logical component substrings or tokens.
Question
The explode() function splits a string into an indexed array at a specified separator.
Question
The concatenation assignment operator (.=) combines two text strings.
Question
The function substr_count() returns the total number of characters in a string.
Question
The strcasecmp() function and the strcmp() function respectively perform a case-insensitive and case-sensitive comparison of strings.
Question
The syntax for the strtok() function is $variable=strtok(string, separators);
Question
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.
Question
The escape character combined with one or more other characters is called an escape sequence.
Question
The str_word_count() function returns the number of digits in a string.
Question
The escape sequence \\ inserts a comment.
Question
All text strings must begin and end with double quotation marks.
Question
An anchor specifies that a pattern must appear at that position in the string.
Question
In PHP, the escape character is the ____.

A) pipe (|)
B) period (.)
C) semicolon(;)
D) backslash(\)
Question
The soundex() function returns a value representing a name's phonetic equivalent.
Question
The metacharacter (^) anchors characters to the end of a string.
Question
Regular expressions are patterns that are used for matching and manipulating strings according to specified rules.
Question
The escape sequence \\ inserts a(n) ____.

A) comment
B) web ink
C) backslash
D) directory
Question
PHP support Perl Compatible Regular Expressions (PCRE).
Question
The levenshtein() function returns the number of characters you need to change for two strings to be the same.
Question
The escape sequence to insert a carriage return is ____.

A) \r
B) \cr
C) \t
D) \\
Question
A structure in which variables are placed within curly braces inside of a string is called a ____.

A) complex string syntax
B) simple string syntax
C) function
D) method
Question
The concatenation operator in PHP is a ____.

A) plus sign (+)
B) period (.)
C) minus sign (-)
D) question mark (?)
Question
The ____ function converts any occurrence of (&), ("), ('), (<), and (>) to their equivalent HTML character entity.

A) converttohtml()
B) specialhtml()
C) htmlspecialchars()
D) convertchars()
Question
A megaphone is an algorithm that returns a code for indexing words by their sound, when pronounced in English
Question
Metacharacters that specify the quantity of a match qualifiers.
Question
The escape character sequence ____ inserts a new line.

A) \l
B) \CR
C) \n
D) \nl
Question
Regular expression patterns are enclosed in opening and closing delimiters.
Question
The strlen() function returns the total ____ in a string.

A) number of numerals
B) number of characters
C) number of occurrences
D) number of words
Question
The metacharacter (.) matches any single character.
Question
The ____ function converts all of the letters in a string to capital letters.

A) strtoupper()
B) stringtoupper()
C) strtolower()
D) stringtolower()
Question
The most commonly used string counting function is the ____ function, which returns the total number of characters in a string.

A) str_count()
B) strlen()
C) strpos()
D) total()
Question
The metacharacter, ____, specifies an anchor at the end of the line.

A) (\)
B) (&)
C) (^)
D) ($)
Question
The concatenation operator in PHP is a ____________________.
Question
The characters contained in a set of parentheses within a regular expression are referred as a ____.

A) subpattern
B) basepattern
C) nested pattern
D) base expression
Question
____ are special characters that define the pattern matching rules in a regular expression.

A) Specialchars
B) Patterncharacters
C) Expressionchars
D) Metacharacters
Question
The ____ function uses a strong encryption algorithm called Message-Digest Algorithm to create a one-way hash of an entered string.

A) strhash()
B) str-ireplace()
C) mda()
D) md5()
Question
The ____ function will remove both leading and trailing spaces from a string.

A) ltrim()
B) rtrm()
C) trim()
D) strtrim()
Question
____________________ syntax allows you to use the value of a variable inside a text string enclosed by double quotation marks.
Question
The ____ quantifier specifies that zero or more of the preceding characters can match.

A) (&)
B) (*)
C) (#)
D) (?)
Question
The similar_text() function returns the number of ____ to strings have in common.

A) characters
B) words
C) numbers
D) sounds
Question
____ quantifiers allow you to more precisely specify the number of times a character must repeat sequentially.

A) Curly brace
B) Curly bracket
C) Parentheses
D) Double quotation marks
Question
The ____ metacharacter is used to specify a range of values in a character class.

A) (-)
B) (+)
C) (@)
D) (')
Question
In a regular expression, a(n) ____ specifies that the pattern must appear at that position in the string.

A) pointer
B) anchor
C) position
D) spotter
Question
The ____ function splits a string into an indexed array.

A) repair()
B) implode()
C) explode()
D) strtok()
Question
The escape character combined with one or more other characters is called a(n) ____________________.
Question
ASCII values range from ____.

A) 0 to 512
B) 0 to 255
C) 1 - 26
D) 1 - 128
Question
Using a ____________________ escape sequence at the end of an echo statement makes XHTML code easier to debug and read.
Question
The ____ metacharacter is used to allow a string to contain an alternate set of substrings.

A) (!)
B) (|)
C) (\)
D) (/)
Question
The ____ function randomly scrambles the order of characters in a string.

A) str_scramble()
B) str_shuffle()
C) str_jumble()
D) str_random()
Question
In PHP, the escape character is the ____________________.
Question
The strcmp() function performs a ____ comparison of two strings.

A) case-insensitive
B) standard
C) case-sensitive
D) sub-standard
Question
The circumflex character (^) used in a character class specifies ____________________ characters to exclude in a pattern match.
Question
The strncmp() function and the strncasecmp() function contain a third argument specifying the ____________________ of characters to compare in the string.
Question
Regular expressions consist of literal characters and ____________________, which are special characters that define the pattern matching rules in an expression.
Question
The argument you pass to the strlen() function is a literal string or string variable whose ____________________ you want to count.
Question
The ____________________ quantifier specifies that one or more sequential occurrences of the preceding characters match.
Question
A(n) ____________________ specifies that a pattern must appear at that position in the string.
Question
The ____________________ function is used to return only a portion of a string.
Question
A()n) ____________________ hash is a fixed length string based on the entered text from which it is almost impossible to determine the original text.
Question
The ____________________ metacharacter is used to specify a range of values in a character class.
Question
The ____________________ functions do not modify the contents of an existing string; instead they return a new string, which is assigned to a variable.
Question
The strtok() function is used to break a string into smaller strings, called ____________________.
Question
Metacharacters that specify the quantity of a match are called ____________________.
Question
ASCII values range from ____________________.
Question
____________________ are patterns that are used for matching and manipulating strings according to specified rules.
Question
The ucfirst() function and the lcfirst() function only change the ____________________ character of a string.
Question
The ____________________ function is can be used to check for palindromes because it reverses the characters in a string.
Question
The ____________________ quantifier specifies that the preceding character in the pattern is optional.
Question
Characters contained in a set of parentheses within a regular expression are referred to as a subexpression or ____________________.
Question
Any characters included in a ____________________ class represent alternate characters that are allowed in a pattern match.
Question
A(n) ____________________ metacharacter in a regular expression pattern specifies that the pattern must contain a value where the metacharacter is located.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/83
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 3: Manipulating Strings
1
An escape character tells the compiler or interpreter to exit the program at the escape character.
False
2
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.
True
3
The opposite of the explode() function is the implode() function.
True
4
The escape sequence to insert a carriage return is \r.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
5
The strchr() function or strrchr() function return a substring from the specified characters to the end of the string.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
6
The concatenation operator (.) combines several string variables and literal strings and assigns the new value to another variable.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
7
ASCII stands for American Standard Code for Internet Information.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
8
The strtok() function breaks a program into functions.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
9
To insert a horizontal tab, use the escape sequence \t.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
10
The term parsing refers to the act of dividing a string into logical component substrings or tokens.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
11
The explode() function splits a string into an indexed array at a specified separator.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
12
The concatenation assignment operator (.=) combines two text strings.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
13
The function substr_count() returns the total number of characters in a string.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
14
The strcasecmp() function and the strcmp() function respectively perform a case-insensitive and case-sensitive comparison of strings.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
15
The syntax for the strtok() function is $variable=strtok(string, separators);
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
16
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.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
17
The escape character combined with one or more other characters is called an escape sequence.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
18
The str_word_count() function returns the number of digits in a string.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
19
The escape sequence \\ inserts a comment.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
20
All text strings must begin and end with double quotation marks.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
21
An anchor specifies that a pattern must appear at that position in the string.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
22
In PHP, the escape character is the ____.

A) pipe (|)
B) period (.)
C) semicolon(;)
D) backslash(\)
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
23
The soundex() function returns a value representing a name's phonetic equivalent.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
24
The metacharacter (^) anchors characters to the end of a string.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
25
Regular expressions are patterns that are used for matching and manipulating strings according to specified rules.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
26
The escape sequence \\ inserts a(n) ____.

A) comment
B) web ink
C) backslash
D) directory
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
27
PHP support Perl Compatible Regular Expressions (PCRE).
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
28
The levenshtein() function returns the number of characters you need to change for two strings to be the same.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
29
The escape sequence to insert a carriage return is ____.

A) \r
B) \cr
C) \t
D) \\
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
30
A structure in which variables are placed within curly braces inside of a string is called a ____.

A) complex string syntax
B) simple string syntax
C) function
D) method
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
31
The concatenation operator in PHP is a ____.

A) plus sign (+)
B) period (.)
C) minus sign (-)
D) question mark (?)
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
32
The ____ function converts any occurrence of (&), ("), ('), (<), and (>) to their equivalent HTML character entity.

A) converttohtml()
B) specialhtml()
C) htmlspecialchars()
D) convertchars()
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
33
A megaphone is an algorithm that returns a code for indexing words by their sound, when pronounced in English
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
34
Metacharacters that specify the quantity of a match qualifiers.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
35
The escape character sequence ____ inserts a new line.

A) \l
B) \CR
C) \n
D) \nl
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
36
Regular expression patterns are enclosed in opening and closing delimiters.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
37
The strlen() function returns the total ____ in a string.

A) number of numerals
B) number of characters
C) number of occurrences
D) number of words
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
38
The metacharacter (.) matches any single character.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
39
The ____ function converts all of the letters in a string to capital letters.

A) strtoupper()
B) stringtoupper()
C) strtolower()
D) stringtolower()
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
40
The most commonly used string counting function is the ____ function, which returns the total number of characters in a string.

A) str_count()
B) strlen()
C) strpos()
D) total()
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
41
The metacharacter, ____, specifies an anchor at the end of the line.

A) (\)
B) (&)
C) (^)
D) ($)
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
42
The concatenation operator in PHP is a ____________________.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
43
The characters contained in a set of parentheses within a regular expression are referred as a ____.

A) subpattern
B) basepattern
C) nested pattern
D) base expression
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
44
____ are special characters that define the pattern matching rules in a regular expression.

A) Specialchars
B) Patterncharacters
C) Expressionchars
D) Metacharacters
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
45
The ____ function uses a strong encryption algorithm called Message-Digest Algorithm to create a one-way hash of an entered string.

A) strhash()
B) str-ireplace()
C) mda()
D) md5()
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
46
The ____ function will remove both leading and trailing spaces from a string.

A) ltrim()
B) rtrm()
C) trim()
D) strtrim()
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
47
____________________ syntax allows you to use the value of a variable inside a text string enclosed by double quotation marks.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
48
The ____ quantifier specifies that zero or more of the preceding characters can match.

A) (&)
B) (*)
C) (#)
D) (?)
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
49
The similar_text() function returns the number of ____ to strings have in common.

A) characters
B) words
C) numbers
D) sounds
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
50
____ quantifiers allow you to more precisely specify the number of times a character must repeat sequentially.

A) Curly brace
B) Curly bracket
C) Parentheses
D) Double quotation marks
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
51
The ____ metacharacter is used to specify a range of values in a character class.

A) (-)
B) (+)
C) (@)
D) (')
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
52
In a regular expression, a(n) ____ specifies that the pattern must appear at that position in the string.

A) pointer
B) anchor
C) position
D) spotter
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
53
The ____ function splits a string into an indexed array.

A) repair()
B) implode()
C) explode()
D) strtok()
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
54
The escape character combined with one or more other characters is called a(n) ____________________.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
55
ASCII values range from ____.

A) 0 to 512
B) 0 to 255
C) 1 - 26
D) 1 - 128
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
56
Using a ____________________ escape sequence at the end of an echo statement makes XHTML code easier to debug and read.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
57
The ____ metacharacter is used to allow a string to contain an alternate set of substrings.

A) (!)
B) (|)
C) (\)
D) (/)
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
58
The ____ function randomly scrambles the order of characters in a string.

A) str_scramble()
B) str_shuffle()
C) str_jumble()
D) str_random()
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
59
In PHP, the escape character is the ____________________.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
60
The strcmp() function performs a ____ comparison of two strings.

A) case-insensitive
B) standard
C) case-sensitive
D) sub-standard
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
61
The circumflex character (^) used in a character class specifies ____________________ characters to exclude in a pattern match.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
62
The strncmp() function and the strncasecmp() function contain a third argument specifying the ____________________ of characters to compare in the string.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
63
Regular expressions consist of literal characters and ____________________, which are special characters that define the pattern matching rules in an expression.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
64
The argument you pass to the strlen() function is a literal string or string variable whose ____________________ you want to count.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
65
The ____________________ quantifier specifies that one or more sequential occurrences of the preceding characters match.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
66
A(n) ____________________ specifies that a pattern must appear at that position in the string.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
67
The ____________________ function is used to return only a portion of a string.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
68
A()n) ____________________ hash is a fixed length string based on the entered text from which it is almost impossible to determine the original text.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
69
The ____________________ metacharacter is used to specify a range of values in a character class.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
70
The ____________________ functions do not modify the contents of an existing string; instead they return a new string, which is assigned to a variable.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
71
The strtok() function is used to break a string into smaller strings, called ____________________.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
72
Metacharacters that specify the quantity of a match are called ____________________.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
73
ASCII values range from ____________________.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
74
____________________ are patterns that are used for matching and manipulating strings according to specified rules.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
75
The ucfirst() function and the lcfirst() function only change the ____________________ character of a string.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
76
The ____________________ function is can be used to check for palindromes because it reverses the characters in a string.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
77
The ____________________ quantifier specifies that the preceding character in the pattern is optional.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
78
Characters contained in a set of parentheses within a regular expression are referred to as a subexpression or ____________________.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
79
Any characters included in a ____________________ class represent alternate characters that are allowed in a pattern match.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
80
A(n) ____________________ metacharacter in a regular expression pattern specifies that the pattern must contain a value where the metacharacter is located.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 83 flashcards in this deck.