Location: PHPKode > projects > PHP Newsgroup Reader > uue_decode.inc
<?php
                           $st1 = $st;

                           if ( $st[0]=='M' )//60 chars lines
                                   $st1 = substr($st,1,60);
                           else
                                   $st1 = substr($st1,1,strlen($st1)-3);



                           if (strlen($st1)>0)    //not the last line
                           for ($i=0;$i<strlen($st1);++$i)
                                   if ( $st1[$i]!=chr(96) )  //not `
                                   {
                                           $temp1 = decbin(ord($st1[$i])-32);   //52 -> 010100
                                           $x = strlen($temp1);
                                           for ($j=1;$j<=6-$x;++$j)
                                                   $temp1 = '0'.$temp1;

                                           $temp = $temp.$temp1;    //glue these 6-bit binaries

                                   }else    //char = ~
                                                   $temp = $temp."000000";    //96 -> 000000

                           for ($i=0;$i<strlen($st1)/4*3;++$i)   //8-bit binaries -> decemials
                                   $file[$num_file] = $file[$num_file].chr(bindec(substr($temp,8*$i,8)));
?>
Return current item: PHP Newsgroup Reader