欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

php数组转换(一维数组转二维数组)

程序员文章站 2022-06-11 10:30:03
...
  1. $asr[1] = array("a","b","c","d");
  2. $asr[2] = array("a","b","c","d");
  3. $asr[3] = array("a","b","c","d");
  4. $newarray = array();
  5. foreach($asr as $a)
  6. {
  7. $newarray[] = $a;
  8. }
  9. print_r($newarray);
  10. ?>
复制代码