generate ramdom number php code example Example 1: php random integer echo random_int(0,50); Example 2: php rand int random_int ( int $min , int $max );