PHP Basics
| 16. | Which of the following is used to display the contents of an array in PHP? |
|---|
A. echo()
B. print()
C. var_dump()
D. all of the above
View Answer Discuss Work SpaceAnswer: option c
Explanation:
The var_dump() function is used to display the contents of an array in PHP.
| 17. | Which of the following is used to get the length of a string in PHP? |
|---|
A. strlen()
B. strlength()
C. length()
D. strlenof()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The strlen() function is used to get the length of a string in PHP.
| 18. | Which of the following is used to convert a string to lowercase in PHP? |
|---|
A. strtolower()
B. tolowercase()
C. lcstring()
D. none of the above
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The strtolower() function is used to convert a string to lowercase in PHP.
| 19. | Which of the following is used to generate a random number in PHP? |
|---|
A. rand()
B. random()
C. random_number()
D. generate_random_number()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The rand() function is used to generate a random number in PHP.
| 20. | Which of the following is used to remove whitespace from the beginning and end of a string in PHP? |
|---|
A. trim()
B. strip()
C. trimstring()
D. none of the above
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The trim() function is used to remove whitespace from the beginning and end of a string in PHP.