Php array rule analysis, php array rule _ PHP Tutorial

Source: Internet
Author: User
Php array uses rule analysis and php array rules. Php array uses rule analysis. php array rules This article analyzes the use rules of arrays in php. Share it with you for your reference. The specific analysis is as follows: the array in php is in the Gray often heavy php array using rule analysis, php array rules

This article analyzes the use rules of arrays in php. Share it with you for your reference. The specific analysis is as follows:

Arrays are very important in php. Strings, images, numbers, and video equivalents all exist in arrays. Therefore, it is necessary to understand the rules of arrays.

1. Key and value.

Basic array format:

array( [key =>]value   , ...)

Key => value, where the key can only be two types: integer and string. Value can be in various forms. except for numbers, other values must be enclosed by ''or. The following example shows the rules:

<?php  $a = array(-1=>2,         -2=>3,   '01'=>'99.jpg',            8,           'a',     'b'=>TRUE,         NULL,            "",      1.2=>0.5,        );       print_r($a);?>

Output result: array ([-1] => 2 [-2] => 3 [01] => 99.jpg [0] => 8 [1] => 0.5 => 1 [2] => [3] =>)

I hope this article will help you with php programming.

In this article, we analyze the rules for using arrays in php. Share it with you for your reference. The specific analysis is as follows: The array is in the gray-often heavy condition in php...

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.