Good evening or morning everyone..
Is there any way to understand this:
$array = ('element 1','element 2','element 3');
while($x=each($array)){
echo $x.' Value:'.$x;
}
I mean where did the 'key' and 'value' come from although they're not defined in the file at all??
Paaat 0 Junior Poster in Training
Recommended Answers
Jump to PostSee the manual page for each. It's in the third section (return values).
Jump to PostI would use foreach in this case
All 8 Replies
Paaat 0 Junior Poster in Training
Hani1991 12 Junior Poster
pritaeas 2,211 ¯\_(ツ)_/¯ Moderator Featured Poster
Stefano Mtangoo 455 Senior Poster
edwinhermann 57 Junior Poster
Paaat 0 Junior Poster in Training
Paaat 0 Junior Poster in Training
edwinhermann 57 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.