Home > Article > Backend Development > Examples of md5 and uniqid functions in php
This article introduces a few small examples of md5 and uniqid functions in PHP for reference by beginners.
1, md5 example <? $id = md5(uniqid(rand())); echo "$id"; ?> 2, use md5 function to encrypt text <?php $val = "secret"; echo "Pre-hash string: $val <br />"; $hash_val = md5 ($val); echo "Hashed outcome: $hash_val"; ?> 3, use uniqid function to generate id <? $id = uniqid("phpuser"); echo "$id"; ?> |