menu

PHP Strings

PHP Strings - Important Points


1. What function is used to determine the length of a string in PHP?

A. strlen()

B. strrev()

C. str_replace()

D. substr()

Discuss Work Space

Answer: option a

Explanation:

The strlen() function is used to determine the length of a string in PHP.

2. Which of the following functions is used to replace a substring with another string in PHP?

A. strpos()

B. str_replace()

C. substr()

D. strtolower()

Discuss Work Space

Answer: option b

Explanation:

The str_replace() function is used to replace a substring with another string in PHP.

3. What function is used to convert a string to all lowercase characters in PHP?

A. strtolower()

B. strtoupper()

C. substr()

D. strrev()

Discuss Work Space

Answer: option a

Explanation:

The strtolower() function is used to convert a string to all lowercase characters in PHP.

4. What function is used to convert a string to all uppercase characters in PHP?

A. strtoupper()

B. strtolower()

C. substr()

D. strrev()

Discuss Work Space

Answer: option a

Explanation:

The strtoupper() function is used to convert a string to all uppercase characters in PHP.

5. Which of the following functions is used to concatenate two or more strings in PHP?

A. strlen()

B. substr()

C. str_replace()

D. strcat()

Discuss Work Space

Answer: option d

Explanation:

The strcat() function is used to concatenate two or more strings 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