Home » PHP » PHP Arrays » Question
  1. Which of the following are correct ways of creating an array?
    1. $Name= array(“Ajit”);
    2. $name[0] = “Ajit”;
    3. name[0] = “Ajit”;
    4. $state[] = array(“Ajit”);
    5. Both A and B
Correct Option: E

A variable name should start with $ symbol which is not present in C) and you need not put the square brackets when you use the array() constructor.



Your comments will be displayed only after manual approval.