menu

PHP Strings

PHP Strings - Important Points


11. Which of the following functions is used to convert special characters to HTML entities in PHP?

A. htmlentities()

B. htmlspecialchars_decode()

C. htmlspecialchars()

D. str_replace()

Discuss Work Space

Answer: option a

Explanation:

The htmlentities() function is used to convert special characters to HTML entities in PHP.

12. Which of the following functions is used to convert HTML entities to their corresponding characters in PHP?

A. htmlentities()

B. htmlspecialchars_decode()

C. htmlspecialchars()

D. str_replace()

Discuss Work Space

Answer: option b

Explanation:

The htmlspecialchars_decode() function is used to convert HTML entities to their corresponding characters in PHP.

13. Which of the following functions is used to insert a substring into a string at a specified position in PHP?

A. str_insert()

B. substr_replace()

C. str_replace()

D. str_splice()

Discuss Work Space

Answer: option b

Explanation:

The substr_replace() function is used to insert a substring into a string at a specified position in PHP.

14. Which of the following functions is used to check if a string contains a specific substring in PHP?

A. strpos()

B. str_replace()

C. strstr()

D. substr()

Discuss Work Space

Answer: option c

Explanation:

The strstr() function is used to check if a string contains a specific substring in PHP.

15. Which of the following functions is used to pad a string with a specified character to a certain length in PHP?

A. str_pad()

B. str_replace()

C. substr()

D. strlen()

Discuss Work Space

Answer: option a

Explanation:

The str_pad() function is used to pad a string with a specified character to a certain length in PHP.


Subscribe for Latest Career Trends
Subscribe Now
Use AI and ChatGPT for Career Guidance

Unlock Your Future

Join Now
Worried for Placements in 2024?

Join FAST TRACK Course

Join Now
Supercharge Your SUCCESS

Join All in One Placement Mock Tests-2024

Join Now