Home  • Programming • PHP

Quiz-PHP string,oop,regular expression

1. Spliting a string into various elements based on Case-Insensitive pattern_

A) preg_search()
B) preg_find()
C) reg_split()
D) preg_split()

2. Which quantifiers matches any string containing a p followed by zero or more instances of the sequence hp ?

A) p(hp)*
B) p*(hp)
C) *hp(p)
D) hp(p)*

3. Why preg_grep() function wiil you use?

A) Searches all elements of an array
B) For grapping the array
C) For grapping the character
D) Searches define elements of an array

4. Which of the following function are used to strips any HTML and PHP tags from the input?

A) fgets()
B) fgetss()
C) fwrite()
D) None

5. Which statement is true about Regular Expressions?

A) describing or matching data according to defined syntax rules
B) allowing to slice and dice text in nearly every conceivable fashion.
C) Used for searching data

6. Which of the following PHP function is used to determine the length of any string?

A) strlen()
B) str_len()
C) count()
D) length()

7. Which is not a POSIX-style regular expression function ?

A) ereg()
B) ereg_replace()
C) spliti()
D) regex()

8. Which of the following PHP function is used to clear HTML tags from sting?

A) remove_tags()
B) strip_tags()
C) clear_tags()
D) cleartags()

9. Which function divides the string str into an array of substrings ?

A) explode()
B) strtok()
C) str()
D) exploded()

10. How to handle string if we use ENT_COMPAT constant as an optional parameter for htmlentities().

A) Convert double quotes and ignore single quotes. This is the default.
B) Ignore both double and single quotes.
C) Convert both double and single quotes.
D) none


Comments 0


Share

Copyright © 2024. Powered by Intellect Software Ltd