In the book I'm reading, the author said that the words $key and $value are arbitrary... but I'm not sure I see how that's possible..
here's the example in the book--------------
// Create the array.
$movies = array (
'10' => 'Casablanca',
'9.65' => 'To Kill a Mockingbird',
'2.35' => 'The English Patient',
'8' => 'Traffic');
// Display the movies sorted by title:
echo 'Sorted by title:<br /><pre>Rating Title
';
asort($movies);
foreach ($movies as $key => $value) {
echo "$key\t$value\n";
}
echo '</pre>';
would it be the same with "$duck" and "$goose" ??--------
// Create the array.
$movies = array (
'10' => 'Casablanca',
'9.65' => 'To Kill a Mockingbird',
'2.35' => 'The English Patient',
'8' => 'Traffic');
// Display the movies sorted by title:
echo 'Sorted by title:<br /><pre>Rating Title
';
asort($movies);
foreach ($movies as $duck => $goose) {
echo "$duck\t$goose\n";
}
echo '</pre>';
------------------------
if it's true that key and value don't have to be called key and value,
how would php know which is the duck and which is the goose ????
am i making any sense.. ???