$a['tmp'] =& $a['t']; // exact same values by reference (no copy)
Only other way I can think of at the moment is to create a copy and unset the original as you described as brute force.
HTH,
Jason k Larson
David T-G wrote:
Hi, all --
If I have an associative array
Array
(
[t] => Array
(
[t1] => temp1
[t2] => temp2
)
[f] => Array
(
[f1] => foo1
[f2] => foo2
)
)
and I want to change the key 't' to, say, 'tmp', is there a way to change
it or do I have to use the brute force
$a[tmp] = $a[t] ;
unset $a[t] ;
approach?
I expect that, however it's done, it works the same way on just a 1-d
assoc array like
Array
(
[t1] => temp1
[t2] => temp2
)
but in particular I have the 2-d array case that I need to play with
today.
TIA & HAND
:-D
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php