- crypt: documentation ( source)
- hash: documentation ( source)
<?php
$salt = '$1$rasmusle$';
$pass = 'foobar';
$algo = 'md5';
$poor = hash($algo, $salt . $pass);
$meh = crypt($pass);
$better = crypt($pass, $salt);
echo "$poor\n";
echo "$meh\n";
echo "$better\n";