<?php
$stack=array("Simon","Elaine");//定义数组
array_push($stack,"Helen","Peter");//入栈
print_r($stack);
<?php
$stack=array("Simon","Elaine");//定义数组
array_unshift($stack,"Helen","Peter");//入栈
print_r($stack);
?>
$stack=array("Simon","Elaine","Helen","Peter");
echo array_pop($stack)."<br>";//出栈
print_r($stack);
?>
<?php
$stack=array("Simon","Elaine","Helen","Peter");
echoarray_shift($stack)."<br>";//出栈
print_r($stack);
?>
网友评论