In computer science, an array data structure, or simply an array, is a data structure consisting of a collection of elements (values or variables), each identified by at least one array index or key. An array is stored such that the position of each element can be computed from its index tuple by a mathematical formula. The simplest type of data structure is a linear array, also called one-dimensional array.
PHP array is the best way to store data on the fly. There are a lot of PHP awesome functions that have a good approach to modern programming. Additionally, around PHP server-side scripting language, the functions play a vital role to be dynamic. Not to mention, PHP is self-power full language but it’s awesome functions make it more powerful and meaning full. Thus, life without it for any PHP frameworks is impossible. Every PHP frameworks use it.
Additionally, one of the very famous PHP function is called array push. It’s magic on array elements and adds new element inside the PHP array.
Lets have a close look with example
The result of the above snippet you will get following
Array (  => White  => Black  => Red  => Yellow  => Cyn )
Also, lets have another example:
Thus, the result of the above snippet you will get following
Array ( [key1] => value1 [key2] => value2 [key3] => value3 [key4] => value4  => Array ( [key1] => value1 [key5] => value5 ) )
Off course you may find the documentation on PHP official website hereI
Thank you for your interest on . Please fill out the form below and send it to us.