How To Create A Random Number In PHP
Computing : Learning PHP Creating a simple random number in PHP is simple and you just call the rand function like this: rand(minimum, max) thus to get a number between 1 and 100 inclusive call: $randnumber = rand(1,100); Note that oftentimes you will want something more random than this and therefore you may wish to seed the function. There are also other functions that can be combined to get a bigger or more likely random number, for instance you can use the time to get a random number.
Questions about learn PHP:
|
|