Array padding for the PHP array Getting Started tutorial

Source: Internet
Author: User
This article describes an example of an array of PHP arrays filled in, with the need for a friend reference.

In PHP programming, the Array_fill () function can be used to populate an array of elements.

Consider the following example, the Array_fill () function-the Fill array function:

 
      ";p Rint_r ($arrayFilled); echo"
"; $keys = Array (" string "," 2 ", 9," SDK "," PK "), $array 2 = Array_fill_keys ($keys," testing "); echo"
";p Rint_r ($array 2); echo"
";? >

Operation Result:

Array ([0] = = Array ([0] = a[1] = b[2] = c[3] + D)

[1] = = Array ([0] = a[1] = b[2] = c[3] + D)

[2] = = Array ([0] = a[1] = b[2] = c[3] + D)

[3] = = Array ([0] = a[1] = b[2] = c[3] + D)

[4] = = Array ([0] = a[1] = b[2] = c[3] + D)

) Array ([string] = testing[2] = testing[9] = testing[sdk] = TESTING[PK] = testing)

  • 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.