這篇文章主要介紹了PHP實(shí)現(xiàn)一維數(shù)組轉(zhuǎn)二維數(shù)組的方法,實(shí)例分析了php操作數(shù)組的技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下
本文實(shí)例講述了PHP實(shí)現(xiàn)一維數(shù)組轉(zhuǎn)二維數(shù)組的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:
<?php
$asr[1] = array("a","b","c","d");
$asr[2] = array("a","b","c","d");
$asr[3] = array("a","b","c","d");
$newarray = array();
foreach($asr as $a)
{
$newarray[] = $a;
}
print_r($newarray);
?>
希望本文所述對大家的php程序設(shè)計(jì)有所幫助。
更多信息請查看IT技術(shù)專欄