3v4l.org

run code in 300+ PHP versions simultaneously
<?php //generate salt-----------------------------------> $password = "texmex"; for ($i=0; $i<=32; $i++) { $d=rand(1,30)%2; $salt .= $d ? chr(rand(65,90)) : chr(rand(48,57)); } //end generate salt--------------------------------| //hash password with salt--> $hashed = md5($password . $salt); //here is your new encrypted password, ready to store in the database table, `jos_users` echo $encrypted = $hashed . ':' . $salt;

preferences:
36.44 ms | 402 KiB | 5 Q