PHP Arrays
6. | Which of the following is not a valid way to loop through an array in PHP? |
---|
A. foreach()
B. for()
C. while()
D. do-while()
View Answer Discuss Work SpaceAnswer: option d
Explanation:
7. | What is the output of the following PHP code snippet? <?php |
---|
A. 0
B. 1
C. 2
D. 3
View Answer Discuss Work SpaceAnswer: option d
Explanation:
8. | What is the output of the following PHP code snippet? <?php |
---|
A. apple
B. banana
C. orange
D. None of the above
View Answer Discuss Work SpaceAnswer: option b
Explanation:
9. | Which function is used to check if a value exists in an array in PHP? |
---|
A. in_array()
B. array_exists()
C. value_in_array()
D. array_contains()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
10. | What is the output of the following PHP code snippet? <?php |
---|
A. ["orange", "banana", "apple"]
B. ["apple", "banana", "orange"]
C. ["orange", "apple", "banana"]
D. None of the above
View Answer Discuss Work SpaceAnswer: option a
Explanation: