關(guān)于PHP實(shí)現(xiàn)數(shù)組隊(duì)列的復(fù)制代碼
復(fù)制代碼 代碼如下:
<?php
$zhan=array("WEB");//聲明一個(gè)數(shù)組當(dāng)做隊(duì)列
array_push($zhan,"PHP");//將字符串壓入棧(數(shù)組)中
array_push($zhan,"WWW.CHHUA.COM");//再壓入一個(gè)元素
print_r($zhan);//打印數(shù)組內(nèi)容
?>
<?php
$zhan=array("WEB","www.chhua.com","WEB開發(fā)筆記","PHP","網(wǎng)站建設(shè)");//聲明一個(gè)數(shù)組當(dāng)做棧
array_shift($zhan);//將字符串出隊(duì)(數(shù)組)中
print_r($zhan);//打印數(shù)組內(nèi)容 Array([0] => WEB[1] => www.chhua.com[2] => WEB開發(fā)筆記[3] => PHP)
?>