Foreach Loop Help v.newtophp
Posted: Mon Mar 13, 2006 11:20 pm
i'm currently reading this book on php and i'm stuck on why the code is the way it is.
for example:
what i don't understand is what specifically in detail $array as $key is doing.
any help will be greatly appreciated.
thank you!
for example:
Code: Select all
$user['firstname'] = 'jack';
$user['lastname'] = 'doe';
$user['age'] = '24';
foreach ($array as $key => $value) {
statements
}any help will be greatly appreciated.
thank you!