kokomjolk Posted August 1, 2008 Share Posted August 1, 2008 Hello from Maine! I am trying to create a sign that will have the numbers 1-200,000 typed out with spaces in between and found an answer using php that had me plugging this in: <?php $lowestnum = 1; $highestnum = 200000; for($i=$lowestnum; $i<=$highestnum; $i++){ echo "$i, "; } ?> I wouldn't be surprised if it was my own incompetence getting in the way, but I am having a tough time making this happen. Any help? Besides my eternal gratitude I could send a funny video of one of my friends wiping out while covering a news story as thanks. Quote Link to comment https://forums.phpfreaks.com/topic/117726-php-integer-question/ Share on other sites More sharing options...
PFMaBiSmAd Posted August 1, 2008 Share Posted August 1, 2008 It would probably help if you told us what it was doing that was not correct, because it works for me (except for the final ", " that would need to be trimmed off.) Quote Link to comment https://forums.phpfreaks.com/topic/117726-php-integer-question/#findComment-605516 Share on other sites More sharing options...
.josh Posted August 1, 2008 Share Posted August 1, 2008 If you wanted the numbers with just spaces then take out the comma in "$i, " also were you wanting to somehow further format it as in make columns/rows? Quote Link to comment https://forums.phpfreaks.com/topic/117726-php-integer-question/#findComment-605520 Share on other sites More sharing options...
kokomjolk Posted August 1, 2008 Author Share Posted August 1, 2008 wow, thanks for the quick responses - i am a true neophyte when it comes to all this, (my training wheels still have visible tread) is there any way to walk me through this? i realize you didn't wake up this morning wondering how you could help a complete stranger, so anything would be very much appreciated thanks again Quote Link to comment https://forums.phpfreaks.com/topic/117726-php-integer-question/#findComment-605528 Share on other sites More sharing options...
kokomjolk Posted August 1, 2008 Author Share Posted August 1, 2008 and what i am trying to accomplish is having all the numbers in order with a space in between them, no needs for rows or columns as they will be reformatted to show how many people have been helped by a local charity Quote Link to comment https://forums.phpfreaks.com/topic/117726-php-integer-question/#findComment-605529 Share on other sites More sharing options...
.josh Posted August 1, 2008 Share Posted August 1, 2008 Okay well if you want just the numbers with a space between them just take out the comma <?php $lowestnum = 1; $highestnum = 200000; for($i=$lowestnum; $i<=$highestnum; $i++){ echo "$i "; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/117726-php-integer-question/#findComment-605531 Share on other sites More sharing options...
kokomjolk Posted August 1, 2008 Author Share Posted August 1, 2008 so with this refined version, all i do now is save a webpage, open it with notepad, and replace the existing code with this? Quote Link to comment https://forums.phpfreaks.com/topic/117726-php-integer-question/#findComment-605533 Share on other sites More sharing options...
.josh Posted August 1, 2008 Share Posted August 1, 2008 well..yeah but it has to have a somepage.php extension and I am assuming that it's being run on a computer (server, whatever) that has server software like apache installed, as well as the php parser.. Quote Link to comment https://forums.phpfreaks.com/topic/117726-php-integer-question/#findComment-605539 Share on other sites More sharing options...
kokomjolk Posted August 1, 2008 Author Share Posted August 1, 2008 we have apache but i am not sure of a php parser (i'd be rolling my eyes too if i were you) Quote Link to comment https://forums.phpfreaks.com/topic/117726-php-integer-question/#findComment-605557 Share on other sites More sharing options...
The Little Guy Posted August 1, 2008 Share Posted August 1, 2008 we have apache but i am not sure of a php parser (i'd be rolling my eyes too if i were you) If you can run php on your computer/server you have a php parser. Quote Link to comment https://forums.phpfreaks.com/topic/117726-php-integer-question/#findComment-605558 Share on other sites More sharing options...
kokomjolk Posted August 1, 2008 Author Share Posted August 1, 2008 thanks for all your help, i think i'm too minor leagues to be playing here, but as promised here is my friend and his stealth coverage of a press conference Quote Link to comment https://forums.phpfreaks.com/topic/117726-php-integer-question/#findComment-605560 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.