PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$array["key1"] = "value1";
$array["key2"] = "maybe value 2";
$array["key3"] = "yes, value 3";
// now the foreach as....
foreach($array as $key=>$value){
echo "array ".$key." has as value: ".$value." <BR>\n";
}
/*
This wil output
array key1 has as value: value1 <BR>
array key2 has as value: maybe value 2 <BR>
array key3 has as value: yes, value3 <BR>
*/
So the 'or' here is no more than 'if (sth1 or sth2)'. Just because only when the first condition is false the second condition will be executed.That using process order of 'or'.
And 'as' is a kind of assignment operator who assign both the key and value of a array to two variables.