本文實例講述了PHP實現一維數組轉二維數組的方法。分享給大家供大家參考。具體實現方法如下:
<?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程序設計有所幫助。