Replace string key of PHP array

Posted by poru on Stack Overflow See other posts from Stack Overflow or by poru
Published on 2010-05-26T23:17:59Z Indexed on 2010/05/26 23:21 UTC
Read the original article Hit count: 231

Filed under:
|

Hello,

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")

© Stack Overflow or respective owner

Related posts about php

Related posts about array