23 Oct

PHP Tutorial: Using Arrays

By: Walt Stoneburner

Arrays are variables that are capable of holding multiple values, a group of data. These are heavily used in development, so in this beginner’s guide I’ll show how to declare, access and manipulate arrays in PHP.

PHP supports indexed, associative, and multidimensional array types.

Declaring Arrays in PHP

Arrays can be defined using the array() function, or from PHP 5.4 you can also just use [ ]. When declaring an indexed array,  indexes are numeric and the first item will start at index 0 and increment with each subsequent element.

Read article