I have an array in PHP which looks like that:
$test = array('3' => 5);
How could I replace the stringed array key 3?
I tried:
$test['3'] = "New value"
but it don’t work, it look like that after that:
array('3' => 5, 3 => "New value")
PHP version: 5.2.11
The most possible way you can get the numerical index represented by string is when you convert object with numeric property name to array.
More detailed this covered here