Quote:
Originally posted by ilya020
When I try this, I get this:
Lists
These are our lists;
log:
blah
0:
foo
list:
fa
0:
blah
I was wondering, why do I get "0:" in there?
|
The code does what you tell it to do, displayes every item in your list, you have a first item, with identifyer "log->blah" that holds value "foo" in the foreach it just tels you that the identifyer log is reffering to the blah, and that the first item (
0) is holding the value foo.
Quote:
Originally posted by ilya020
EDIT: I know that using the foreach is more C style than PHP...O well!
|
It is _not_ C style, it is a derived feature from the C shell where foreach is buildin as a special command. php programmers just thought it would be a useful command in the php language aswell.
If anything I would say foreach orriginates from perl (
http://www-106.ibm.com/developerwork...ry/l-p560.html)