0% found this document useful (0 votes)
3 views3 pages

Array Functions

The document lists various PHP array functions, detailing their purposes and functionalities. Each function is briefly described, covering operations such as changing key cases, merging arrays, filtering elements, and sorting. The functions range from basic array manipulations to more complex operations involving callbacks and recursive actions.

Uploaded by

ikadehchris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Array Functions

The document lists various PHP array functions, detailing their purposes and functionalities. Each function is briefly described, covering operations such as changing key cases, merging arrays, filtering elements, and sorting. The functions range from basic array manipulations to more complex operations involving callbacks and recursive actions.

Uploaded by

ikadehchris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1. array_change_key_case: Changes the case of all keys in an array.

2. array_chunk: Splits an array into chunks.

3. array_column: Returns the values from a single column in the input array.

4. array_combine: Creates an array by using one array for keys and another for values.

5. array_count_values: Counts all the values of an array.

6. array_diff: Computes the difference of arrays.

7. array_diff_assoc: Computes the difference of arrays with additional index check.

8. array_diff_key: Computes the difference of arrays using keys for comparison.

9. array_fill: Fills an array with values.

10. array_fill_keys: Fills an array with values, specifying keys.

11. array_filter: Filters elements of an array using a callback function.

12. array_flip: Exchanges all keys with their associated values in an array.

13. array_intersect: Computes the intersection of arrays.

14. array_intersect_assoc: Computes the intersection of arrays with additional index


check.

15. array_intersect_key: Computes the intersection of arrays using keys for


comparison.

16. array_key_exists: Checks if a key exists in an array.

17. array_keys: Returns all the keys or a subset of the keys of an array.

18. array_map: Applies a callback function to the elements of the given arrays.

19. array_merge: Merges one or more arrays.

20. array_merge_recursive: Recursively merges one or more arrays.

21. array_multisort: Sorts multiple or multi-dimensional arrays.

22. array_pad: Pads an array to the specified length with a value.

23. array_pop: Pops the element off the end of the array.

24. array_product: Calculates the product of values in an array.

25. array_push: Pushes one or more elements onto the end of an array.
26. array_rand: Picks one or more random entries out of an array.

27. array_reduce: Reduces an array to a single value using a callback function.

28. array_replace: Replaces elements from passed arrays into the first array.

29. array_replace_recursive: Recursively replaces elements from passed arrays into


the first array.

30. array_reverse: Returns an array with elements in reverse order.

31. array_search: Searches the array for a given value and returns the first
corresponding key if successful.

32. array_shift: Shifts an element off the beginning of the array.

33. array_slice: Extracts a slice of the array.

34. array_splice: Removes a portion of the array and replaces it with something else.

35. array_sum: Calculates the sum of values in an array.

36. array_udiff: Computes the difference of arrays by using a callback function for data
comparison.

37. array_udiff_assoc: Computes the difference of arrays with additional index check,
with a callback function.

38. array_udiff_uassoc: Computes the difference of arrays with additional index check,
compares data and indexes by a callback function.

39. array_uintersect: Computes the intersection of arrays by using a callback function


for data comparison.

40. array_uintersect_assoc: Computes the intersection of arrays with additional index


check, with a callback function.

41. array_uintersect_uassoc: Computes the intersection of arrays with additional


index check, compares data and indexes by using callback functions.

42. array_unique: Removes duplicate values from an array.

43. array_unshift: Prepends one or more elements to the beginning of an array.

44. array_values: Returns all the values of an array.

45. array_walk: Applies a user function to every member of an array.


46. array_walk_recursive: Applies a user-supplied function recursively to every
member of an array.

47. arsort: Sorts an array in reverse order and maintains index association.

48. asort: Sorts an array and maintains index association.

49. compact: Creates an array containing variables and their values.

50. count: Counts all elements in an array, or something in an object.

51. current: Returns the current element in an array.

52. each: Returns the current key and value pair from an array and advances the array
cursor.

53. end: Advances array’s internal pointer to the last element.

54. extract: Imports variables into the current symbol table from an array.

55. in_array: Checks if a value exists in an array.

56. key: Fetches a key from an array.

57. krsort: Sorts an array by key in reverse order.

58. ksort: Sorts an array by key.

59. list: Assigns variables as if they were an array.

60. natcasesort: Sorts an array using a case insensitive natural order algorithm.

61. natsort: Sorts an array using a natural order algorithm.

62. next: Advances the internal pointer of an array.

63. prev: Rewinds the internal array pointer.

64. range: Creates an array containing a range of elements.

65. reset: Sets the internal pointer of an array to its first element.

66. rsort: Sorts an array in reverse order.

67. shuffle: Randomizes the order of the elements in an array.

68. sizeof: Alias of count().

69. sort: Sorts an array.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy