I am trying to assign keys to an associative array, but the keys are being rejected.
This works:
$myarray = array();
$key = "row_1";
$val = "some value";
$myarray = array_merge($myarray,array($key=>$val));
However, this does not:
$i = 1;
$myarray = array();
$key = "row_".$i;
$val = "some value";
$myarray = array_merge($myarray,array($key=>$val));
The only difference is how I set the value of $key.
It makes no sense. Any help would be appreciated.
Thanks