Category «Working with PHP arrays»

PHP array functions

List of functions that work with php arrays. array_shift() array_shift() – Shifts the first value of the array off and returns it, shortening the array by one element and moving everything down. All numerical array keys will be modified to start counting from zero while literal keys won’t be touched. array_pop() array_pop() – pop the …

PHP Arrays

An array is a collection of related values (a list of items) such as names of cities Creating an array $numbers = array(); //empty array To create an array use the function array() like: Numeric Arrays Numeric Arrays are arrays that use only numeric keys, called as numeric, indexed or ordered arrays. Associative Arrays Associative …