$item) { echo "Item #" . ($num + 1) . " Price: " . $item . "\n"; } echo "\nSubtotal: " . $subtotal . "\n"; echo "Tax: " . round(($subtotal * tax), 2) . "\n"; echo "Total: " . $total . "\n\n"; // Loop for driving change entry while(true) { if ($total < 0) { echo "\nYour change is " . round((-1 * $total), 2) . ". Have a nice day.\n"; break; } else if ($total == 0) { echo "\nHave a nice day.\n"; } $input = readline("Insert payment value: "); if (!is_numeric($input)) { echo "Invalid value. Try again.\n"; } $total = round($total - (float)$input, 2); if ($total > 0) { echo "Remaining total is: " . $total . "\n"; } } ?>