Common php array operation functions

Source: Internet
Author: User

<? Php
Array_values () // returns all elements in the array
Array_walk () // use a custom function to traverse an array.
Arsort (); // reserve the relationship between the values of the array subscript for inverted sorting
Asort () // reserve the relationship between the subscript and value of the array for forward order
Compact () // import the variable to the array and use the variable name as the subscript. The value is the value.
Extract () // import the array to the variable. The subscript is the variable name and the value is the value.
Count () // count the number of elements in the array
Current () // elements indicated by the current pointer
Next () // move the pointer down
Prev () // move the pointer up
End () // move the pointer to the end of the array
Reset () // move the pointer to the beginning of the array
Key () // returns the subscript of the element specified by the current pointer
Each () // returns a pair of key/value
List () // import the array to the variable
Krsort () // Sort by subscript in reverse order
Ksort () // Sort by subscript in ascending order
Range () // create an array
Sort () // sort values in ascending order
Rsort () // Sort by value to values
Shuffle () // random arrangement
Usort () // This function is left blank, so Google will try again.
?>

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.