Thread: whats 0:
View Single Post
Old 01-25-2003, 07:45 AM   #4 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,709
redhead is on a distinguished road
Re: whats 0:

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)
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote