doforumda Posted June 5, 2010 Share Posted June 5, 2010 Hi, Can we do something like this in for loop $y = $total_eid + 1; for($x = $y; $x <= $total; $x++) { some code to process } i am trying this but it is not working for me how can i achieve such kind of task Link to comment https://forums.phpfreaks.com/topic/203970-need-help-in-for-loop/ Share on other sites More sharing options...
kenrbnsn Posted June 5, 2010 Share Posted June 5, 2010 Saying "i am trying this but it is not working for me" does not help us. What is not working? What are you trying to do? Ken Link to comment https://forums.phpfreaks.com/topic/203970-need-help-in-for-loop/#findComment-1068294 Share on other sites More sharing options...
Muffins Posted June 5, 2010 Share Posted June 5, 2010 Is $total defined anywhere in your script? That could be the issue. Link to comment https://forums.phpfreaks.com/topic/203970-need-help-in-for-loop/#findComment-1068295 Share on other sites More sharing options...
doforumda Posted June 5, 2010 Author Share Posted June 5, 2010 it displays this kind of error Notice: Undefined offset: 3 in C:\wamp\www\pkbook\p_pr\edu.php on line 31 Notice: Undefined offset: 3 in C:\wamp\www\pkbook\p_pr\edu.php on line 32 Notice: Undefined offset: 3 in C:\wamp\www\pkbook\p_pr\edu.php on line 33 Notice: Undefined offset: 3 in C:\wamp\www\pkbook\p_pr\edu.php on line 34 Notice: Undefined offset: 3 in C:\wamp\www\pkbook\p_pr\edu.php on line 35 Notice: Undefined offset: 3 in C:\wamp\www\pkbook\p_pr\edu.php on line 36 Notice: Undefined offset: 3 in C:\wamp\www\pkbook\p_pr\edu.php on line 37 3 is the value of $x yes $total is defined. Link to comment https://forums.phpfreaks.com/topic/203970-need-help-in-for-loop/#findComment-1068297 Share on other sites More sharing options...
doforumda Posted June 5, 2010 Author Share Posted June 5, 2010 this is what i am trying to do. $y = $total_eid + 1; for($x = $y; $x <= $total; $x++) { $c = $cert[$x]; $i = $i_name[$x]; $ci = $c[$x]; $fm = $from_month[$x]; $fy = $from_year[$x]; $tm = $to_month[$x]; $ty = $to_year[$x]; } Link to comment https://forums.phpfreaks.com/topic/203970-need-help-in-for-loop/#findComment-1068298 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.