PHP Basics
26. | Which of the following is used to add an element to the beginning of an array in PHP? |
---|
A. array_push()
B. array_pop()
C. array_shift()
D. array_unshift()
View Answer Discuss Work SpaceAnswer: option d
Explanation:
The array_unshift() function is used to add an element to the beginning of an array in PHP.
27. | Which of the following is used to remove the first element from an array in PHP? |
---|
A. array_push()
B. array_pop()
C. array_shift()
D. array_unshift()
View Answer Discuss Work SpaceAnswer: option c
Explanation:
The array_shift() function is used to remove the first element from an array in PHP.
28. | Which of the following is used to check if a variable is an array in PHP? |
---|
A. is_array()
B. array()
C. isArray()
D. none of the above
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The is_array() function is used to check if a variable is an array in PHP.
29. | Which of the following is used to check if a variable is set and not NULL in PHP? |
---|
A. isset()
B. empty()
C. defined()
D. none of the above
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The isset() function is used to check if a variable is set and not NULL in PHP.
30. | Which of the following is used to check if a variable is empty in PHP? |
---|
A. isset()
B. empty()
C. defined()
D. none of the above
View Answer Discuss Work SpaceAnswer: option b
Explanation:
The empty() function is used to check if a variable is empty in PHP.