|
||||||||||||||||||||||
Array Basics : Your Basic ArrayIt may be helpful to think of an array as a container that holds orderd sets of information. The infromation is stored in the form of "Key = Value." For instance:
0 = apple 1 = orange 2 = bananna 3 = grape
Now let's put them into an array called "fruits":
$fruits = array("apple", "orange", "bananna", "grape");... and we get the following:
$fruits[0] == "apple" $fruits[1] == "orange" $fruits[2] == "bananna" $fruits[3] == "grame"
You can also assign names to the keys, rather than using
$fruits = array("zero" => "apple",
"one" => "orange",
"two" => "bananna",
"three" => "grape");
Which yields:
$fruits["zero"] == "apple" $fruits["one"] == "orange" $fruits["two"] == "bananna" $fruits["three"] == "grame
Author: Kelli
|
tutorial Pages
|
|||||||||||||||||||||