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

WBOY
Release: 2016-07-13 10:06:13
Original
1084 people have browsed it

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;>
Copy after login

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...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!