Describes the very useful array function (reprint) associative array in several PHP4 equivalent to a hash array in Perl. I used to think that PHP didn't ...
perl| Function | Array describes the very useful "array" functions in several PHP4
1 void Extract (array var_array [, int extract_type] [, string prefix]])
Expands an associative array to the variable name and the value of the variable, and if there is a conflict, the following argument specifies the processing Method!
Such as:
<php?
/* Suppose that $var _array is a array returned from
Wddx_deserialize *
2 Array Compact (mixed varname [, mixed ...])
Instead of the above function, save the variable name and the value of the variable to the associative array!
Such as:
$city = "San Francisco";
$state = "CA";
$event = "SIGGRAPH";
$result result is Array ("event" => "SIGGRAPH", "City" => "San Francisco", "state" => "CA").
3 bool In_array (mixed needle, array haystack)
To determine if there is a value in the array
4 void Natsort (array array)
Sort the array in natural numbers, when 12 will be at the back of 2
$array 1 = $array 2 = Array ("Img12.png", "Img10.png", "Img2.png", "img1.png");
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.