basic functions of array manipulationThe key name and value of the arrayArray_values ($arr); Gets the value of the array Array_keys ($arr), gets the key name of the array array_flip ($arr), and the values in the array are exchanged with the key
There is a multi-dimensional array, which can be customized. If we want to find a subIndex value in this array, we can use methods such as for and foreach to traverse and find the reverse. If we give one or more keys at will, you must find the keys
Php basic knowledge Summary (1) array, basic knowledge array
I. Sorting1. asort-Positive Sorting to maintain the index relationship2. arsort-reverse sorting to maintain the index relationship3. sort -- sorting from the lowest to the highest4. ksort -
There is a multi-dimensional array, which can be customized. Suppose we want to find a key in this array for me:
Traverse multi-dimensional arrays and create an index for all keys to generate a one-dimensional array;
Check the upper-level array and
PHP operation array functions. Ange ($ low, $ high), range ($ low, $ high, $ step); create an array of sequential values, for example, range () is) for example, range (a, z) each ($ array) returns the current element of the array in sequence, and
I think so:
Traverse multi-dimensional arrays and create an index for all keys to generate a one-dimensional array;
Check the upper-level array and data of the key by using the key name each time.
OK. The Code is as follows:
IndexKey:
Copy codeThe
I think so:Traverse multi-dimensional arrays and create an index for all keys to generate a one-dimensional array;Check the upper-level array and data of the key by using the key name each time.OK. The Code is as follows:IndexKey:Copy codeThe Code
: This article mainly introduces php programming notes. if you are interested in PHP tutorials, please refer to them. Three methods for php to obtain POST data
Php image watermarking source code
Php + ajax + json is the simplest example.
Php Chinese
Some php array learning notes. There are three types of php arrays: a numeric array with a numeric ID key, and an ID key in an array associated with a value multi-dimensional array containing one or more arrays, there are three types of php arrays:
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.