Forum Moderators: coopster
$array = array('moo', 'cow', 'moo');
echo '<pre>';
print_r($array);
echo '</pre>';
array(
0 => 'moo',
1 => 'cow',
2 => 'moo');
You could have also made an array with the same values, but stipulating what the keys are - which will behave differently depending on what you do with it:
$array = array('sound' => 'moo', 'animal' => 'cow', 'name' => 'moo');
The code I gave you above will only work if you have a non-associative array - i.e., one you didn't set the keys on yourself, so each '$key' has a number that can be measured.
And you can see what's inside your array. You'd do well, too, to find a tutorial or something to help wrap your brain around arrays - the first time you use them they can be tricky - but later you can't live without them, you'll be using them without even thinking about it.