php - How to do process with for() function and give return true in the last -
i have project, , have 1 problem. can me? have code:
for($i=0; $i < $rows; $i++){ if(do_something == true){ return true; }else{ return false; } }
if, have 10 data, , want do_something
process data. problem is, script stop in first data. so, delete return true;
, leave blank. script process data. question is, how can put return true;
in end of process, know no error in process.
use this:
for($i=0; $i < $rows; $i++){ if(do_something == false){ return false; } } return true;
it "do something" long successful, , until done, , abort @ first "false" result of "do something".
Comments
Post a Comment