Perl to php

I want to convert this to php

Code (text):

$password = md5_base64($password);

I tried this but failed

$password =  md5($password);
$password = base64_encode($password);

I’m tired and need to head off now, but maybe?

$password =  md5($password, true);
$password = base64_encode($password);

Same as md5(), but will return the digest as a base64 encoded string. The length of the returned string will be 22 and it will only contain characters from this set: ‘A’…‘Z’, ‘a’…‘z’, ‘0’…‘9’, ‘+’ and ‘/’.

If the optional raw_output is set to TRUE, then the md5 digest is instead returned in raw binary format with a length of 16.

Thanks solved using this way


Well md5 nowadays is no longer secure enough to encrypt your data, instead you should try sha1, or even sha512 unless you have to compensate for old data already encrypted using md5.