A >>
The range () function quickly creates an array of simple methods that populate the array with an integer value of low to high range, and the function returns an array containing all the integers in the secondary range. The form is as follows
Array range (int low,int high[,int Step])
Typical usage is as follows
Example: Set up 1-6 of 6-digit arrays (DICE)
$die = range (0,6);
Set up 0-30 arrays of all numbers
$even = (0,20,2);//Step 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 letters from A to Z will be created. This can be used to generate a validation code function.
b >>
Round () function
This function is afraid I'm confused. This function is different from which range () above.
The role of this function is to
The precision 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 can extract multiple values from an array in one operation. Assign values to variables at the same time. The form is as follows
void list (mixed)
Typical usage
Copy Code code as follows:
<?php
$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 the third one
list (,, $power) = $info;
echo "I need $power!\n";
?>
( | )
list($name,$occupation,$color) = exolode("|",$line);