Hello, I want to convert the perl function below to PHP function, if someone could help a little bit I'd appreaciate it:
sub encode32
{
$_=shift;
my($l,$e);
$_=unpack('B*',$_);
s/(.....)/000$1/g;
$l=length;
if($l & 7)
{
$e=substr($_,$l & ~7);
$_=substr($_,0,$l & ~7);
$_.="000$e" . '0' x (5-length $e);
}
$_=pack('B*', $_);
tr|\0-\37|A-Z2-7|;
lc($_);
}
Thanks in advance.