Home  >  Article  >  Backend Development  >  How to convert one-dimensional array to two-dimensional array in PHP, php dimensional array to two-dimensional array_PHP tutorial

How to convert one-dimensional array to two-dimensional array in PHP, php dimensional array to two-dimensional array_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:06:131140browse

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:

<&#63;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);
&#63;>

I hope this article will be helpful to everyone’s PHP programming design.

www.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...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn