WPDev.one

wp_rand()

wp_rand( mixed $min = null, mixed $max = null )

Generates a random non-negative number.

Parameters 2 required

Name / Type Description
int

$min Optional. Lower limit for the generated number. Accepts positive integers or zero. Defaults to 0.

Required
int

$max Optional. Upper limit for the generated number. Accepts positive integers. Defaults to 4294967295.

Required

Return Value

(int)
A random non-negative number between min and max.

Function Information

Since Version
2.6.2
Source File
wp-includes/pluggable.php
Advertisement