Lucky2710 Posted August 5, 2010 Share Posted August 5, 2010 Is there a better alternative way of doing this? for($i=0; $i< 12; $i++) { myFunction($a[$i],$b[$i]); } The goal is to run this function 12 times and using different numbers each time (from variables a & b [Which both variables are arrays]) But is there a better way to make it run 12 times? Link to comment https://forums.phpfreaks.com/topic/209852-i-help/ Share on other sites More sharing options...
kenrbnsn Posted August 5, 2010 Share Posted August 5, 2010 What does the function look like? It may be more reasonable to pass the arrays and the number of times to run the loop in to the function and perform the loop within the function. Ken Link to comment https://forums.phpfreaks.com/topic/209852-i-help/#findComment-1095389 Share on other sites More sharing options...
Lucky2710 Posted August 5, 2010 Author Share Posted August 5, 2010 the arrays are like $a = array($input1 = $_POST[F0], $input2 = $_POST[F2]); ect. I was asking this as a general question/ thought though Link to comment https://forums.phpfreaks.com/topic/209852-i-help/#findComment-1095391 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.