Random number in PHP

Real quick little function to get a random number using PHP.

PHP:
  1. $x = rand(1,100);

The variable $x will contain a random number between 1 and 100.

It's rand(min, max) if you don't want to use 1 and 100 as your limits.

Bookmark and Share

Post Info

Leave a Reply