Jump to content

Hello everyone my first post in this forum


cleverlyslick

Recommended Posts

what's up php freaks. This is my first post in this forum and I am a newb at PHP(just started reading and toying with php about 2 weeks ago).

 

I've been developing static,boring websites for a year now and want to make them a little more dynamic and a friend of mine recommended me learning php.it's been a nightmare ever since lol but I am hooked on learning this program and would like to conquer it if possible.

 

Currently, I am working on building my first dynamic website and my question is this....

 

I want to use numbers from 200 to 1000 and want to put it in an array. Now I know how to do arrays,but I wanted to know if it's possible to shorten up the numbers in the arrays say for example like $array = array(200-300, 301 - 600, 601-800, 801-1000)and still have each individual number function properly instead of manually having to enter each number in the array without affecting the numbers when a user types it in? say for example a user wants to type 223 and gets the result with no problems.

 

It just seems sloppy coding for me to have to manually enter each number in the array. I hope this post makes sense and hopefully get some responses.

 

Thanks,

 

cleverly "not so" slick

 

 

so you want the numbers 200-1000 in a array? dont hand type it thats the manual way use a while loop or for loop

 

Thanks dad00, that's exactly what I was looking for

 

 

 

 

It always pays to browse the documentation first for answers to basic "can php/how to do this in php" questions - http://www.php.net/manual/en/function.range.php

 

Thanks for the reference PF I will be sure to read through this site. appreciate the quick responses.

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.