<!DOCTYPE html> <html> <body> <?php $a=array(0=>"red",1=>"green"); array_unshift($a,"blue"); print_r($a); ?> </body> </html>
运行结果
Array ( [0] => blue [1] => red [2] => green )
<!DOCTYPE html> <html> <body> <?php $a=array(0=>"red",1=>"green"); array_unshift($a,"blue"); print_r($a); ?> </body> </html>
运行结果
Array ( [0] => blue [1] => red [2] => green )