Online GK Series

This site is dedicated to the aspirants of competitive exams SSC, UPSC, Railways, Postal Assistants, Bank, GATE and NET

Get Attractive Job

PHP Multiple Choice Questions and Answers

Questions
6 Which function is used to remove HTML Tags from a string in PHP?
A regex
B strip_tags()
C replaceAll()
D stripHtmlTags()

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()

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()

Answer: Option [C]
9 Which function is used to compare strings as strings in PHP ?
A startswith()
B strcmp()
C compare()
D compareTo()

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()

Answer: Option [C]

Chapters

Useful Computer Science EBooks