Php5 and mysql5web Development Technical details 1-php array. 1. create immediately or extract range () to quickly create an array of specified element values. Example: range () range (, 2) range (a, z) shuffle () disrupt the array order array_rand () specify 1, then create or then extract
Range () quickly creates an array of specified element values.
Example:
Range (0, 6)
Range (0, 10, 2)
Range ('A', 'z ')
Shuffle () disrupts the array order
Array_rand () specifies the number of elements to be extracted immediately. If you extract an element and return a variable, multiple elements are extracted and the index array is returned.
2. array sorting
Sort () sorting by ASCII code priority: numbers, letters, Chinese characters
Asort () is sorted by array associativity
Ksort () in ascending order of array index values
Krsort () in descending order of array index values
3. statistical functions
Array_count_values
Array_sum (array $ a) array element sum
Count ()
Sizeof ()
4. array processing
Array_combine (array a1, array a2) array merges a1 as the key name, and a2 as the key value
Array_unique (array $)
Array_flip () key-value reconciliation
5. search
Array_key_exists ($ key_str, $ array)
In_array ($ value_str, $ array, [bool])
6. move the internal pointer of the array
Current ()
Next ()
Prev ()
End ()
7. get the joined array key name
Key ()
8. access the key and key value of the array
Array_keys ()
Array_values ()
9. determine the array type (to be supplemented)
Is_array ()
10. display content and structure
Print_r ()
Var_dump ()
Var_export ()
11. insert and remove elements
Unset ()
Array_shift ()
Insert at the top of array_unshift ()
Array_splice ()
Array_push ()
Array_pop ()
12. export content as a variable
Extract ()
13. others
List ()
Each ()
For ()
Foreach ()
Distance is created immediately or range () is extracted immediately to create an array of specified element values. For example, range () range (, 2) range (a, z) shuffle () breaks down the array order specified by array_rand...