Problem Statement
Which of the following can be used to create an array in PHP?
Explanation
Arrays can be created using the array() function or square brackets from PHP 5.4 onward.
Code Solution
SolutionRead Only
$a = array(1,2,3); $b = [1,2,3];
Get the Preplance app for a seamless learning experience. Practice offline, get daily streaks, and stay ahead with real-time interview updates.
Get it on
Google Play
4.9/5 Rating on Store
PHP · Interview Question
Detailed answer, explanation and code for this interview question. Ideal for PHP interview preparation, coding rounds and viva questions.
Which of the following can be used to create an array in PHP?
$a = array(1,2,3); $b = [1,2,3];

Master PHP with our complete collection of questions, tutorials and guides.