Forum Moderators: coopster
<?phpPrints
$array = array("1","2","3");
foreach($array as $int){
// array_push($array, 'push');
$array[]='push';
}
print '<pre>';
print_r($array);
pre '</pre>';
?>
ArrayNote that foreach operates on a copy of the specified array and not the array itself.
(
[0] => 1
[1] => 2
[2] => 3
[3] => push
[4] => push
[5] => push
)