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 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. 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!! 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
Archived
This topic is now archived and is closed to further replies.