PHP Strings
PHP Strings - Important Points
16. | Which of the following functions is used to count the number of occurrences of a substring in a string in PHP? |
---|
A. strpos()
B. str_replace()
C. substr_count()
D. strlen()
View Answer Discuss Work SpaceAnswer: option c
Explanation:
The substr_count() function is used to count the number of occurrences of a substring in a string in PHP.
17. | Which of the following functions is used to convert a string to an array in PHP? |
---|
A. str_split()
B. explode()
C. implode()
D. substr()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The str_split() function is used to convert a string to an array in PHP.
18. | Which of the following functions is used to convert an array to a string in PHP? |
---|
A. str_split()
B. explode()
C. implode()
D. substr()
View Answer Discuss Work SpaceAnswer: option c
Explanation:
The implode() function is used to convert an array to a string in PHP.
19. | Which of the following functions is used to compare two strings in PHP? |
---|
A. strcmp()
B. str_replace()
C. strlen()
D. substr()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The strcmp() function is used to compare two strings in PHP.
20. | Which of the following functions is used to extract a substring from a string in PHP? |
---|
A. strpos()
B. str_replace()
C. substr()
D. strlen()
View Answer Discuss Work SpaceAnswer: option c
Explanation:
The substr() function is used to extract a substring from a string in PHP.