Jump to content

Home on the "range"


Brickley

Recommended Posts

Hello everyone,

 

Try as I might, "range" is not producing the kind of result I was expecting - I'm looking for a range of numbers (in this case 0 - 99) separated by commas and maybe a space (it that's not asking too much.

 

foreach (range(0, 99) as $zipCount) {// Buid array of 100 numbered elements

echo $zipCount;

}

 

...produces this result - one long number rather than 100 numbers with commas and spaces

 

0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899

 

I've tried it on safari, ff and ie7 with the same results.

 

Any thoughts?

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/148891-home-on-the-range/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.