$bric = array("Brazil", "Russia", "India", "China");
$ric = $bric; // array copy
$br = array_shift($ric); // left shift at $ric. $br stores "Brazil"
print_r($bric); // $bric remains the same
print_r($ric); // $ric lost "Brazil"
Output:
Array
(
[0] => Brazil
[1] => Russia
[2] => India
[3] => China
)
Array
(
[0] => Russia
[1] => India
[2] => China
)
Reference: PHP array_shift at php.net.
Be First to Comment