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()
View Answer Discuss Work SpaceAnswer: 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()
View Answer Discuss Work SpaceAnswer: 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()
View Answer Discuss Work SpaceAnswer: 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()
View Answer Discuss Work SpaceAnswer: 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()
View Answer Discuss Work SpaceAnswer: option d
Explanation:
The strcat() function is used to concatenate two or more strings in PHP.