What is the correct way to create an array in PHP?
-
A
arr()
-
B
array()
Correct answer
-
C
arr = []
-
D
array = ()
Correct answer
B. array()
18 views
Explanation
Arrays in PHP can be created using the array() function or [].
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ