PHP Array Operation function Summary _php tutorial

Source: Internet
Author: User
The most commonly used data structure in PHP is arrays, which can help us solve a large part of the programming problem. In fact, there are a lot of array operations without our own writing, the system has come with the relevant functions. Let's describe some of the functions of the PHP array operation, perhaps some of which you have not heard of.

  1. Searches for a specific value in the array and returns TRUE if found returns false
  2. Boolean In_array (mixed Needle,array Haystack[,boolean Strict])
  3. Finds a specified health in the array, returns true if found or false
  4. Boolean array_eky_exists (mixed Key,array array)
  5. Searches for a specific value in the array and returns TRUE if found returns false
  6. Boolean array_search (mixed Needle,array Haystack[,boolean Strict])
  7. Gets a new array of all the key elements of the array
  8. Array Array_keys (array array[,mixed search_value])
  9. Gets a new array of all the values in the array
  10. Array array_values (array array)
  11. Determining the size of an array
  12. Integer count (array array[,int mode]) integer sizeof (array array[,int mode])
  13. Statistical array element Occurrence frequency
  14. Array array_count_values (array array)
  15. Removes duplicate values from an array, returning an array of unique values
  16. Array array_unique (array array)
  17. Inverse array element order, Preserve_key If true, the array key value order is unchanged
  18. Array array_reverse (array Array[,boolean Preserve_key])
  19. Permutation array keys and values
  20. Array array_flip (array array)
  21. Array order ordering, sort_flags parameter optional, default behavior
  22. Sort_numberic, sorted by numeric value, is useful for sorting integers or floating-point numbers sort_regular, sorting sort_string by ASCII values, sorting asort functions in the correct order of the people's knowledge, the order of the key values is not changed void sort (array Array[,int sort_flags]) void Asort (array array[,int sort_flags])
  23. Array in reverse order, sort_flags parameter optional, default behavior
  24. Sort_numberic, sorted by numeric value, is useful for sorting integers or floating-point numbers sort_regular, sorting sort_string by ASCII values, sorting arsort function key values in the right order of access to People's knowledge (array Array[,int sort_flags]) void Arsort (array array[,int sort_flags])
  25. Array Natural Sorting
  26. void Natsort (array array)
  27. Case-insensitive natural sorting
  28. void Natcasesort (array array)
  29. To sort the key values in an array
  30. Boolean ksort (array array[,int sort_flags])
  31. Order of the key values in the reverse sequence
  32. Boolean krsort (array array[,int sort_flags])
  33. Sort by user-defined order
  34. void Usort (array array,callback function_name)
  35. Merges the arrays together to return an array of unions. Array_merge is covered in front, Array_merge_recursive merged together
  36. Array Array_merge (array Array1[array array2 ...]) More than one array array_merge_recursive (array Array1,array array2[,array ...]) More than two
  37. Keys and values make up a new array
  38. Array array_combine (array Key,array value)
  39. Returns the part of an array, starting with the offset, to the end of the offse+length position
  40. Array array_slice (array array, int offset [, int length])
  41. Removes all elements from offset start to end of Offset+length and returns the deleted element as an array
  42. Array Array_splice (array, int offset [, int length[,array peplacement]])
  43. To find the intersection of the array, the key value is the first array of key values
  44. Array array_intersect (array Array1,array array2[,arrayn ...])
  45. The intersection of the array contains the key values equal to the key values in the first array
  46. Array Array_intersect_assoc (array Array1,array array2[,arrayn ...])
  47. To find the difference set of the array, the first array has no value in the other array
  48. Array Array_diff (array Array1,array array2[,arrayn ...])
  49. To find the difference set of the array, the first array in the other array does not have values that contain the key values equal
  50. Array Array_diffassoc (array Array1,array array2[,arrayn ...])
  51. Returns one or more key values in an array
  52. Mixed Array_rand (array array[,int num_entries])
  53. Shuffle function immediately
  54. void Shuffle (array input_array)
  55. Sum the values in an array
  56. Mixed array_sum (array array);
  57. Decomposes an array into a multidimensional array that contains a size element
  58. Array array_chunk (array array, int size [, Boolean Preserve_keys])

http://www.bkjia.com/PHPjc/752578.html www.bkjia.com true http://www.bkjia.com/PHPjc/752578.html techarticle The most commonly used data structure in PHP is arrays, which can help us solve a large part of the programming problem. In fact, there are a lot of array operation without our own writing, the system has come from the phase ...

  • 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.