Associative arrays
Posted: 26 Feb 2026 11:29
From the Scripting > Arrays section in the help:
Have I misunderstood something or is the output incorrect?
[EDIT: Forgot to add my XY version. I'm on 27.20.1000.)
However, if the empty array is created first:If the index or key is invalid the variable is seen just as a bit of text:Code: Select all
$a["pussy"] = "cat"; echo "It is a $a['fussy']!"; //It is a $a['fussy']!
Code: Select all
$a = array();
$a["pussy"] = "cat";
echo "It is a $a['fussy']!"; //It is a cat![EDIT: Forgot to add my XY version. I'm on 27.20.1000.)