Read Also: Top 20 MCQ Questions on Perl Regular Expressions in PHP
1) The … function performs a binary-safe, case sensitive comparison of two strings.
A. strspn()
B. strcspn()
C. strcmp()
D. strcomp()
2) The … function performs a case insensitive comparison of two strings.
A. strcaseicmp()
B. strcasecmp()
C. strcasecomp()
D. strspn()
3) The functions returs the length of the first segment of the string containing characters not found in another string.
A. strspn()
B. strcspn()
C. strcmp()
D. strcomp()
4) The functions returs the length of the first segment of the string containing characters also found in another string.
A. strspn()
B. strcspn()
C. strcmp()
D. strcomp()
5) The … function capitalizes the first letter of the string str if it is alphabetical.
A. strcap()
B. firstcap()
C. ucfirst()
D. ucasefirst()
6) The … function capitalizes the first letter of each word in a string.
A. ucwords()
B. firstcap()
C. ucfirst()
D. ucasewords()
7) The … function converts all newline (/n) characters in a string to their XHTML compliant equivalent, <br/>.
A. newline()
B. break()
C. nl2br()
D. nlbr()
8) Which of the following characters that htmlspacechars() can convert.
i. & (ampersand)
ii. ” (double quote)
iii. ‘ (Single quote)
A. i and ii only
B. i and iii only
C. ii and iii only
D. All i, ii and iii
9) The … function will delete all the HTML and PHP tags from the string altogether.
A. strip_tags()
B. delete_tags()
C. tags_strip()
D. tags_delete()
10) You can translate text to its HTML equivalent using the … function.
A. translate_text()
B. html_translation_text()
C. html_translation_table()
D. get_html_translation_table()
11) The … is capable of reversing the text-to-html translation and vice-versa.
A. translate_text_html()
B. html_translation_text()
C. html_text_flip()
D. array_flip()
12) The … function converts all characters in a string to their corresponding match found in a predefined array.
A. array_str()
B. strtr()
C. strtok()
D. array_flip()
13) The … function parses the string based on a predefined list of characters.
A. strstr()
B. strtr()
C. strtok()
D. strpos()
14) The … function finds the position of the first case-sensitive occurrence of a substring in a string.
A. strstr()
B. strtr()
C. strtok()
D. strpos()
15) The … function finds the position of the last occurrence of a string returning its numerical position.
A. strstr()
B. strtr()
C. strrpos()
D. strpos()
16) The … function returns the remainder of a string beginning with the first occurrence of a predefined string.
A. strstr()
B. strtr()
C. substr()
D. substr_count()
17) The … function returns the part of a string located between a predefined starting offset and length positions.
A. strstr()
B. strtr()
C. substr()
D. substr_count()
18) The … function returns the number of times one string occurs within another.
A. strstr()
B. strtr()
C. substr()
D. substr_count()
19) The … function removes various characters from the beginning of a string, including white space, the horizontal tab(\t), newline(\n), carriage return(\r), Null(\o), and vertical tab(\xob).
A. rtrim()
B. ltrim()
C. trim()
D. ctrim()
20) The function … offers information regarding the total number of words found in a string.
A. str_word_count()
B. str_count()
C. word_count()
D. count_words()
Answers
- C) strcmp()
- B) strcasecmp()
- B. strcspn()
- A. strspn()
- C. ucfirst().
- A. ucwords()
- C. nl2br()
- D. All i, ii and iii
- A. strip_tags()
- D. get_html_translation_table()
- D. array_flip()
- B. strtr()
- C. strtok()
- D. strpos()
- C. strrpos()
- A. strstr()
- C. substr()
- D. substr_count()
- B. ltrim()
- A. str_word_count()
Comments are closed.