PHP Array Functions



PHP has very strong array features by using the array, it is very easy to use and access the data in PHP, By default PHP provides many array functions to access and manipulate the elements of array.

In my previous post we just discussed about the PHP Array Introduction and described types of the Array, short code for array etc. In this post I am just moving forward and describing array functions provides by the PHP.

1. PHP array() function
PHP array() function allows you to create indexed, associative and multidimensional arrays. PHP array() function is used to create an array and it returns an array.

array ([ mixed $... ] )
<?php    
$direction = array("east","west","north","south");    
echo "Directions are :- $direction[0], $direction[1], $direction[2], $direction[3]";    
?>    

Output:

Directions are :- east, west, north, south

Below is the list of other prebuilt Array functions of PHP:
1. array_​push
2. array_​pop
3. array_​change_​key_​case
4. array_​chunk
5. array_​column
6. array_​merge
7. array_​combine
8. array_​count_​values
9. array_​diff_​assoc
10. array_​diff_​key
11. array_​diff_​uassoc
12. array_​diff_​ukey
13. array_​diff
14. array_​fill_​keys
15. array_​fill
16. array_​filter
17. array_​flip
18. array_​intersect_​assoc
19. array_​intersect_​key
20. array_​intersect_​uassoc
21. array_​intersect_​ukey
22. array_​intersect
23. array_​key_​exists
24. array_​key_​first
25. array_​key_​last
26. array_​keys
27. array_​map
28. array_​merge_​recursive
29. array_​multisort
30. array_​pad
31. array_​product
32. array_​rand
33. array_​reduce
34. array_​replace_​recursive
35. array_​replace
36. array_​reverse
37. in_​array
38. array_​search
39. array_​shift
40. array_​slice
41. array_​splice
42. array_​sum
43. array_​udiff_​assoc
44. array_​udiff_​uassoc
45. array_​udiff
46. array_​uintersect_​assoc
47. array_​uintersect_​uassoc
48. array_​uintersect
49. array_​unique
50. array_​unshift
51. array_​values
52. array_​walk_​recursive
53. array_​walk
54. arsort
55. asort
56. compact
57. count
58. current
59. end
60. extract
61. key_​exists
62. key
63. krsort
64. ksort
65. list
66. natcasesort
67. natsort
68. next
69. pos
70. prev
71. range
72. reset
73. rsort
74. shuffle
75. sizeof
76. sort
77. uasort
78. uksort
79. usort

Deprecated in latest PHP :
80. each

In the previous post I describe regarding the Introduction of PHP Array.

Hope this article helps you in PHP development and understandings of Array. Stay tuned for more PHP Tutorials, Hope you enjoyed reading, if you need the professional PHP, PHP Framework and Magento 2 Development we can help you, just Click on the Link and send me your requirements.