PHP method to convert one-dimensional array to two-dimensional array, php dimensional array to two-dimensional array
The example in this article describes the method of converting a one-dimensional array to a two-dimensional array in PHP. Share it with everyone for your reference. The specific implementation method is as follows:
<?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);
?>
Copy after login
I hope this article will be helpful to everyone’s PHP programming design.
http://www.bkjia.com/PHPjc/960710.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/960710.htmlTechArticlePHP method of converting one-dimensional array to two-dimensional array, php dimensional array two-dimensional array This article describes the PHP implementation with examples Method to convert one-dimensional array to two-dimensional array. Share it with everyone for your reference. Specific actual...