Which Of The Following Are Correct Ways Of Creating An Arrayp #32
Which of the following are correct ways of creating an array?</p> <pre><code class="language-php"> i) state[0] = "karnataka"; ii) $state[] = array("karnataka"); iii) $state[0] = "karnataka"; iv) $state = array("karnataka");</code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs107 PHP: Hypertext Preprocessor. It can also be found in gs gs107 PHP Array - PHP Array - Quiz No.1.
Which 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");
iii) and iv)
ii) and iii)
Only i)
ii), iii) and iv)