paruby Posted July 21, 2008 Share Posted July 21, 2008 I have a "foreach" function. Is there a way to get the number of items in it, like the "mysql_num_rows" function for getting the # of rows? In case it matters, here is my foreach function :: foreach($_POST['athlete'] as $athletevalue) Thanx! Pete Quote Link to comment https://forums.phpfreaks.com/topic/115772-solved-foreach-way-to-know-how-many-items-in-it/ Share on other sites More sharing options...
ratcateme Posted July 21, 2008 Share Posted July 21, 2008 have you tried count() $num = count($_POST['athlete']); Scott. Quote Link to comment https://forums.phpfreaks.com/topic/115772-solved-foreach-way-to-know-how-many-items-in-it/#findComment-595184 Share on other sites More sharing options...
paruby Posted July 21, 2008 Author Share Posted July 21, 2008 Duh! That worked great - thanx!! Quote Link to comment https://forums.phpfreaks.com/topic/115772-solved-foreach-way-to-know-how-many-items-in-it/#findComment-595201 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.