10-30-2011, 02:13 PM
(This post was last modified: 10-30-2011, 02:14 PM by ★Cooldude★.)
An array is used as an alternative to using multiple variables to hold values.
PHP Code:
<?PHP
$array = ("One", "Two", "Three"); //Define the array
Echo $array[0]; //Will echo "One"
Echo $array[2]; //Will echo "Three"
foreach ($array as $value){
Echo "$value, "; //Will echo "One, Two, Three, "
}
?>