PHP implementation of one-dimensional array to two-dimensional array _php tutorial

Source: Internet
Author: User
Tags php programming

A method of implementing one-dimensional array to two-dimensional array in PHP


This article mainly introduces PHP implementation of a one-dimensional array to two-dimensional array of methods, examples of the PHP operation of the array of techniques, with a certain reference value, the need for friends can refer to the next

In this paper, we describe the method of implementing one-dimensional array to two-dimensional array in PHP. Share to everyone for your reference. The implementation method is as follows:

1

2

3

4

5

6

7

8

9

10

11

$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);

?>

I hope this article is helpful to everyone's PHP programming.

http://www.bkjia.com/PHPjc/960582.html www.bkjia.com true http://www.bkjia.com/PHPjc/960582.html techarticle a method of implementing one-dimensional array to two-dimensional array in PHP this article mainly introduces the implementation of a one-dimensional array of PHP to two-dimensional array of methods, examples of PHP operation of the array of techniques, with a certain reference ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.