Php programming language MCQ : Function and String(Regular expressions) : Link5

Php programming language MCQ : Function and String(RE) : Link5

Function and String MCQ

       Are you worried about the answers to PHP programming-Function and String-Comparing strings, Manipulating and searching strings, Regular expressions questions? We have arranged the Show Answer button under the each question. Candidates can click on it to know the right option among the given alternatives. Furthermore, the applicants can check our web portal @ www.totalmcq.com to take part in more MCQ on various subject. Wish, the given information about the Function and String MCQ will helpful to the advance and can learn the various types of questions and answers.


Q.1. In PHP’s regular expression, ------- matches any string containing at least one a.

A. a*                                                              B. a
C. a+                                                       D. a{1}

Q.2. The regular expression,------- matches any string containing zero or more a’s.

A. a*                                                              B. a
C. a+                                                       D. a{1}

Q.3. The PHP’s regular expression function, ------- executes a case-sensitive search of string for a defined pattern.

A. eregi()
B. ereg()
C. regi()
D. regse()

Q.4. The predefined character class ------ will specify whitespace characters, including space, horizontal tab, vertical tab, newline, form feed, or carriage return.

A. [:tab:]
B. [:space:]
C. [:whitespace:]
D. [:char:]

Q.5. The ------ function converts each character in a string into a bracketed expression containing two characters.

A. eregi()
B. eregcase()
C. sql_regcase()
D. regcase()

Q.6. The ----- function will split a string into various elements based on case insensitive pattern.

A. eregi()
B. ereg()
C. split()
D. spliti()

Q.7. The ------ function will be useful when checking the validity of strings, such as passwords.

A. Peregi()
B. ereg()
C. regi()
D. regse()

Q.8. You can perform case insensitive search with the function ------- in PHP’s regular expression.

A. eregi()
B. ereg()
C. regi()
D. regse()

Q.9. State Whether the following statements are True or False.
i. A regular expression is nothing more than a pattern of characters itself that was matched against a certain parcel of text.
ii. It may be a pattern with which you are already familiar or it may be a pattern with specific meaning in the context of the word of pattern matching.

A. i-True, ii-False
B. i-False, ii-True
C. i-False, ii-False
D. i-True, ii-True

Q.10. The ------ matches any string not containing any of the characters ranging from a through z and A through Z.

A. [a-zA-Z]                                                                                B. {^a-zA-Z}
C. [^a-zA-Z]                                                                             D. [^a-z-A-Z]