<?php $totalhousesleft = 1; $iteration = 0; for($x = 8000; $x > 0; $x = $x - 10){ if(empty($iteration)) { $iteration = $x/1000; } if ($totalhousesleft >= $x) { $currentprice = $iteration; $sellingprice = $currentprice + 1; break; } $iteration++; } if(empty($currentprice)){ $currentprice = $iteration; $sellingprice = $currentprice + 1; } var_dump($currentprice, $sellingprice);
You have javascript disabled. You will not be able to edit any code.