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"; ?> Copy after login 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"; ?> Copy after login 3, use uniqid function to generate id <? $id = uniqid("phpuser"); echo "$id"; ?> Copy after login |