In some languages like python you can just say
for a in b
do something
with a being a primative and b being a list
can this be done in php or do i have to do it the c/java.. way with arrays and all that mess.
quick php question
Started by CoryMathews, Nov 07 2007 06:15 PM
3 replies to this topic
#1
Posted 07 November 2007 - 06:15 PM
#2
Posted 07 November 2007 - 06:17 PM
#3
Posted 07 November 2007 - 07:02 PM
Note that as referenced in that manual, iterating through an object (such as a list) is not conveniently possible in php < 5.
foreach() only works on arrays with that exception (their while(list...each) method being the supperior method, but still not able to handle objects).
foreach() only works on arrays with that exception (their while(list...each) method being the supperior method, but still not able to handle objects).
#4
Posted 08 November 2007 - 09:50 AM
well im not dealing with object just yet but imma give both the foreach a try see if it was what i was hoping for.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
