This question already has an answer here:
I’m now learning PHP array but I have a question about the array operator. I saw an example when creating an array like this:
<?php
$array = array();
$array["a"] = "apple";
$array["b"] = "banana";
?>
Do I really need to declare the variable as array
first?
Or can I just ignore the first line: $array = array();
?
</div>