Hi all i'm developing a console mode program that will prompt the user for a start and end number and then display all numbers in order between the start and end number. So for example if a user types in 10 for the start and 20 for the end it should come out like this, 10,11,12,13,14,15,16,17,18,19,20 Heres the code so far i know i've probably made an amatuer mistake any help would be much appreciated. #!/usr/local/bin/php -q <?php //phpprogram.php require ("phpio"); print("\n\n"); print ("enter start number : "); $start = input(); print("\n\n"); print ("enter end number : "); $end = input(); while ($end <=$end) { print("\n "); print($start); $start = $end +1; } print("\n\n "); ?> Code (markup): Thanks.
Thanks i got it working but now it's doing a continuous loop. This is what the code looks like now not sure if i placed it incorrectly or not? #!/usr/local/bin/php -q <?php //phpprogram.php require ("phpio"); print("\n\n"); print ("enter start number : "); $start = input(); print("\n\n"); print ("enter end number : "); $end = input(); while ($start <=$end) { print("\n"); echo implode(',', range($start, $end)); } print("\n\n "); ?> Code (markup):