A >>
The range () function quickly creates an array of simple methods, populates the array with an integer value of low to high, and the function returns an array containing all the integers in the sub-range. The form is as follows
Array range (int low,int high[,int Step])
Typical usage is as follows
Example: Creating an array of 1-6 6 numbers (DICE)
$die = range (0,6);
Create 0-30 arrays of all even-numbered
$even = (0,20,2);//step is 2
This function can be used not only as a number, but also as a letter.
Such as
$words = Range (' A ', ' Z ');
An array of all the letters that contain a through Z is created. This can be used to generate Authenticode functions.
b >>
Round () function
This function is afraid to confuse me. This function is a huge difference from which range above.
The purpose of this function is to
The accuracy of the floating-point number
Float round (float var[,int preisin})
Typical usage
Example: $pi = 3.141592653;
Round ($PI, 4);
Echo $pi;
Will output 3.1415
Three >>
List () function
The list () function extracts multiple values from an array in a single operation. Assign a value to the variable at the same time. The form is as follows
void list (mixed)
Typical usage
Copy the code code as follows: $info = Array (' coffee ', ' brown ', ' caffeine ');
Listing all the variables List ($drink, $color, $power) = $info; echo "$drink is $color and $power makes it SPECIAL.N";
Listing some of them List ($drink,, $power) = $info; echo "$drink has $power. N";
Or Let's skip to only the third one List (,, $power) = $info; echo "I need $power!n";
?> |
The example above is from the PHP manual, which can be used with the list () to cut strings into variable tables typical usage list ($name, $occupation, $color) = Exolode ("|", $line);
http://www.bkjia.com/PHPjc/371927.html www.bkjia.com true http://www.bkjia.com/PHPjc/371927.html techarticle a range () function is a simple way to quickly create an array, populating an array with an integer value of low to high, and the function returns an array that contains all the integers in the sub-range. Form the following array ra ...