MCQ
Single Best Answer
Not Set
QWhich of the following are correct ways of creating an array?
(i) state[0] = "karnataka";
(ii) $state[] = array("karnataka");
(iii) $state[0] = "karnataka";
(iv) $state = array("karnataka");
ID: #2380
Arrays in PHP MCQ
1,662 views
Question Info
#2380Q ID
Not SetDifficulty
Arrays in PHP MCQTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer: Option A
Explanation
A variable name should start with $ symbol which is not present in i) and you need not put the square brackets when you use the array() constructor.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic