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