jeudi 13 juillet 2017

If statement on a number and it's multipliers

I want to make a loop that works in 2 ways , if period is anynumber but 13 and it's multiplications , it will call the last income I had , if not it should make the equations you see below , any idea how to ?

for ($i=1; $i <= $period ; $i++) { 
         if ($i+=13) {
         echo round($income=$income*(1+($rowage/100))). "<br>";
         } else
         {
        echo $income. "<br>";
         }
    }

Aucun commentaire:

Enregistrer un commentaire