首页 >后端开发 >php教程 >php数组转换(一维数组转二维数组)

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

WBOY
WBOY原创
2016-07-25 08:51:431008浏览
  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. ?>
复制代码


声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn