PHP Arrays (Cont.)
Associative Arrays (Cont.)
If the ID key of an associative array is a string, it could be doubly quoted or singly quoted.
†According to the Stack Overflow, using array key names without quotes is a legacy feature in PHP.
It was originally the way to do it, but it is no longer recommended and is only still supported for backward compatibility.
This also shows the servers undcemcs01
(this page) and undcemcs02
use different versions of PHP, 7.2.34 and 5.4.16, respectively.
Multidimensional Arrays
In a multidimensional array, each element in the main array can also be an array.
And each element in the sub-array can be an array, and so on.
The arrays could be associative arrays too.
It seems variable interpolation does not work for a multidimensional array element.
For example,
echo "$families[$arr2][$i]<br />";
is not working.
You have to use the following command instead:
echo $families[$arr2][$i] . "<br />";