function for specifying what crypt to use.  Defaults to DES.  For your own enjoyment, add blowfish and DES_EXT support or make it auto detect the strongest crypt available.Use like so;
define("_SALT_","MD5");
$crypted_pass = crypt($plainText,salt());function salt() {$prefix = "";if(_SALT_ == "DES" && CRYPT_STD_DES == 1) {
$length = 2;
}
elseif(_SALT_ == "MD5" && CRYPT_MD5 == 1) {
$length = 9;
$prefix = "$1$";
}
else {
$length = 2;
}$salt = ""; 
for($x=0;$x<$length;$x++) {
$salt .= substr(crypt(rand(1,65536)),3,1);
}return $prefix . $salt;
}