int random(int $num)

Returns a random number between 0 and $num-1.