Detailed PHP array functions

Counting the number of array elements 1.count () and sizeof ()

Output display

2.each () Returns the current element key names and values, and the internal pointer is moved forward

Output display

3.list () is used to set a variable assignment

Output display

4. Sort the array elements: sort (), asort () and ksort () is in a forward direction, rsort (), arsort () and krsort () is a reverse sort

Output display

5.array_count_values ​​() count the number of duplicate arrays

Output display

6.current (): Displays the first element in the array

Output display

The total number of elements in the array 10 represents an additional selective inclusive; 7.array_pad ($, 10,0)

Output display

8.unset () to delete variables

Output display

9.array_fill () creates an array

Output display

10.array_combine () to create a new array by combining two arrays, one array element for the keys, the key element is another array

Output display

11.array_splice () to delete an array members

Output display

12.array_unique delete duplicate values ​​in the array

Output display

13.array_flip () and key values ​​array exchange

Output display

14.array_search () the location where the search value

Output display

3

 

 

 

Published 22 original articles · won praise 0 · Views 734

Guess you like

Origin blog.csdn.net/cldimd/article/details/104662037