linccce

Mystique

Sep 25th, 2014
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.30 KB | None | 0 0
  1. foreach (range(1,$max_days, 1) as $days){
  2.     $total = 0
  3.     echo $total;
  4.     foreach($model->fetchSomefruits($days) as $fruit){
  5.         if($fruit == 'fresh')
  6.             $total+=2;
  7.         elseif($fruit == 'rotten')
  8.             $total-=1;
  9.         else
  10.             $total+=1;
  11.     }
  12.     echo $total; //How can I go back and have the same value as I have now?
  13. }
Advertisement
Add Comment
Please, Sign In to add comment