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