Download PDF
This section covers PHP multiple choice Questions and Answers on PHP Strings
(6)
Which function is used to remove HTML Tags from a string in PHP?
[A]
regex
[B]
strip_tags()
[C]
replaceAll()
[D]
stripHtmlTags()
Comment
Answer: Option [B]
The strip_tags() function removes HTML tags from a string
(7)
Which function is used to decode URL encoded strings in PHP ?
[A]
HttpUtility.UrlDecode()
[B]
URLDecoder()
[C]
getByte()
[D]
rawurlencode()
Comment
Answer: Option [D]
The rawurldecode() function decodes URL-encoded strings in PHP
(8)
Which function is used to convert Ampersands(&) to &, Double quotes("") to " in PHP
[A]
htmlDecode()
[B]
regex
[C]
htmlspecialchars()
[D]
parse()
Comment
(9)
Which function is used to compare strings as strings in PHP ?
[A]
startswith()
[B]
strcmp()
[C]
compare()
[D]
compareTo()
Comment
Answer: Option [B]
To compare strings as strings in PHP strcmp() is used.
(10)
In PHP, which function converts strings to lowercase before comparing them ?
[A]
lower()
[B]
toLowerCase()
[C]
strcasecmp()
[D]
lc()
Comment
Please share this page
Chapters