note 77423 deleted from function.array-shift by nlopess
| From: | nlopess@php.net | Date: | Sat, 01 Sep 2007 12:14:49 +0000 |
| Subject: | note 77423 deleted from function.array-shift by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-130025@lists.php.net to get a copy of this message | ||
Note Submitter: yukotan
----
My friend is very embarrassed.
<?php
echo "<pre><code>";
$a = array( "a" => 1, "5" => 3 , "b" => 2, "3"
=> 9);
echo "\n---- before \$a ----\n";
var_dump($a);
echo "\n---- after \$a ----\n";
$b = array_shift($a);
var_dump($a);
echo "\n---- after\$b ----\n";
var_dump($b);
echo "</code></pre>";
?>
---- before $a ----
array(4) {
["a"]=>
int(1)
[5]=>
int(3)
["b"]=>
int(2)
[3]=>
int(9)
}
---- after $a ----
array(3) {
[0]=>
int(3)
["b"]=>
int(2)
[1]=>
int(9)
}
---- after $b ----
int(1)
How can I solve this?