Array Functions in php

Uncategorized 0 Comment 3

1. array() Creates an array
2. array_change_key_case() Returns an array with all keys in lowercase or uppercase
3. array_chunk() Splits an array into chunks of arrays
4. array_combine() Creates an array by using one array for keys and another for its values
5. array_count_values() Returns an array with the number of occurrences for each value
6. array_diff() Compares array values, and returns the differences
7. array_diff_assoc() Compares array keys and values, and returns the differences
8. array_diff_key() Compares array keys, and returns the differences
9. array_diff_uassoc() Compares array keys and values, with an additional user-made function check, and returns the differences
10. array_diff_ukey() Compares array keys, with an additional user-made function check, and returns the differences
11. array_fill() Fills an array with values
12. array_filter() Filters elements of an array using a user-made function
13. array_flip() Exchanges all keys with their associated values in an array
14. array_intersect() Compares array values, and returns the matches
15. array_intersect_assoc() Compares array keys and values, and returns the matches
16. array_intersect_key() Compares array keys, and returns the matches
17. array_intersect_uassoc() Compares array keys and values, with an additional user-made function check, and returns the matches
18. array_intersect_ukey() Compares array keys, with an additional user-made function check, and returns the matches
19. array_key_exists() Checks if the specified key exists in the array
20. array_keys() Returns all the keys of an array
21. array_map() Sends each value of an array to a user-made function, which returns new values
22. array_merge() Merges one or more arrays into one array
23. array_merge_recursive() Merges one or more arrays into one array
24. array_multisort() Sorts multiple or multi-dimensional arrays
25. array_pad() Inserts a specified number of items, with a specified value, to an array
26. array_pop() Deletes the last element of an array
27. array_product() Calculates the product of the values in an array
28. array_push() Inserts one or more elements to the end of an array
29. array_rand() Returns one or more random keys from an array
30. array_reduce() Returns an array as a string, using a user-defined function
31. array_reverse() Returns an array in the reverse order
32. array_search() Searches an array for a given value and returns the key
33. array_shift() Removes the first element from an array, and returns the value of the removed element
34. array_slice() Returns selected parts of an array
35. array_splice() Removes and replaces specified elements of an array
36. array_sum() Returns the sum of the values in an array
37. array_udiff() Compares array values in a user-made function and returns an array
38. array_udiff_assoc() Compares array keys, and compares array values in a user-made function, and returns an array
39. array_udiff_uassoc() Compares array keys and array values in user-made functions, and returns an array
40. array_uintersect() Compares array values in a user-made function and returns an array
41. array_uintersect_assoc() Compares array keys, and compares array values in a user-made function, and returns an array
42. array_uintersect_uassoc() Compares array keys and array values in user-made functions, and returns an array
43. array_unique() Removes duplicate values from an array
44. array_unshift() Adds one or more elements to the beginning of an array
45. array_values() Returns all the values of an array
46. array_walk() Applies a user function to every member of an array
47. array_walk_recursive() Applies a user function recursively to every member of an array
48. arsort() Sorts an array in reverse order and maintain index association
49. asort() Sorts an array and maintain index association
50. compact() Create array containing variables and their values
51. count() Counts elements in an array, or properties in an object
52. current() Returns the current element in an array
53. each() Returns the current key and value pair from an array
54. end() Sets the internal pointer of an array to its last element
55. extract() Imports variables into the current symbol table from an array
56. in_array() Checks if a specified value exists in an array
57. key() Fetches a key from an array
58. krsort() Sorts an array by key in reverse order
59. ksort() Sorts an array by key
60. list() Assigns variables as if they were an array
61. natcasesort() Sorts an array using a case insensitive “natural order” algorithm
62. natsort() Sorts an array using a “natural order” algorithm
63. next() Advance the internal array pointer of an array
64. pos() Alias of current()
65. prev() Rewinds the internal array pointer
66. range() Creates an array containing a range of elements
67. reset() Sets the internal pointer of an array to its first element
68. rsort() Sorts an array in reverse order
69. shuffle() Shuffles an array
70. sizeof() Alias of count()
71. sort() Sorts an array
72. uasort() Sorts an array with a user-defined function and maintain index association
73. uksort() Sorts an array by keys using a user-defined function
74. usort() Sorts an array by values using a user-defined function

Leave a comment

You must be logged in to post a comment.

© 2016 4frienz. Powered By Flowers

Back to Top