Search results for 'mt_rand'. 1 post(s) found.
- 2007/10/16 How to make random number ?
Generate a Random Number using mt_rand. From the php documentation- "If called without the optional min, max arguments mt_rand() returns a pseudo-Random value between 0 and RAND_MAX. If you want a Random Number between 5 and 15 (inclusive), for example, use mt_rand (5, 15)."
<?php
echo mt_rand() . "\n";
echo mt_rand() . "\n";
//generate Random Number between 5 and 15
echo mt_rand(5, 15);
?>
echo mt_rand() . "\n";
echo mt_rand() . "\n";
//generate Random Number between 5 and 15
echo mt_rand(5, 15);
?>
sample output :
1604716014
1478613278
6
1478613278
6
Another posts included in "PHP"
| form action - detect form post (0) | 2007/10/16 |
| for loop - simple (0) | 2007/10/16 |
| How to ban / block IP addresses (0) | 2007/10/16 |
| How to force cookies, disable php sessid in URL ? (0) | 2007/10/16 |
| How to check if a file exists ? (0) | 2007/10/16 |
| How to include a file with error reporting ? (0) | 2007/10/16 |
| PHP if...else... example (0) | 2007/10/16 |
| PHP form handling example in single page (0) | 2007/10/16 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 05:28
moneyideas
-
Subject different money making ideas
2010/01/29 14:11
moneyideas
-
Subject different money making ideas
2010/01/31 16:42
moneyideas

Prev

Rss Feed