Jump to content

Making an array of 'n' digits


Recommended Posts

Dear friends,

 

It's not just the way of coding but I want to now how can we make an array of "n" digits, for example if "n" equals "3" then we should have an array of 100 to 999, and for "n" equal 2 we should have array of 10 to 99.

 

Any help or ideas how to do this will be appriciated!

Link to comment
https://forums.phpfreaks.com/topic/148603-making-an-array-of-n-digits/
Share on other sites

Thanks, it seems to be a good idea, But actually I want to do it with any value for "n". maybe user enter 10 as "n" so we need to have array of 1000000000 to 9999999999.

 

like this, we need to have a large switch statement, I am looking for a gerenarl way or formula for this.

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.