Generate random number in php

In this tutorial we will show you multiple ways to generate random number using Php code. There are many ways to generate random numbers in php, we will show you some in this tutorial.

Php provides some inbuilt functions to generate random numbers.

Method 1.

Method 2.

Method 3.

That’s it. You have now multiple ways to generate random String/Number. In next post you learn How to verify unique random String/Number before submitting it into database.