random number generator of 1 to 10 in php code example Example: php random number generator <?php echo rand(1,50); ?>