Press "Enter" to skip to content

How to create unique id in php?


In Php, we can create a unique id in PHP using uniqid() function.

Examples For Creating a Unique Id:-

1. //creates a unique id $id = uniqid(); 
   echo $a; echo "<br>";

2. //create a unique id with random $id = uniqid(rand(), true);
    echo $c;
3. //this md5 encrypts the username from above, so its ready to be stored in your database $md5c = md5($c); 
    echo $md5c;
How can we get the IP address of the client in PHP?

Leave a Reply

Your email address will not be published. Required fields are marked *