Get random values from –10 to 10. : mt_rand « Math « PHP
- PHP
- Math
- mt_rand
Get random values from –10 to 10.
<?php
echo "rand(-10, 10) = " . rand(-10, 10) . "\n";
echo "mt_rand(-10, 10) = " . mt_rand(-10, 10) . "\n";
?>
Related examples in the same category