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