This is my function:
function rp_md5 ($string)
{
return md5(strrev($string) . $string);
}
I wish to convert it to a inline anonymous function and I have already tried this code:
$foo = $_POST['u_pwd'];
$pwd = function() use($foo) {
return md5(strrev($foo) . $foo);
};
How I can store new password in the variable $pwd?
normally I must call it:
echo $pwd($foo);
sorry for my bad explanation.
use($foo)?use? Why not simply$pwd=function($foo) {return md5(strrev($foo) . $foo);};$pwdin the variable$pwdif your function is already called$pwdwithout losing that function definition