Mailparse mailparse_uudecode_all

(PECL mailparse >= 0.9.0)

mailparse_uudecode_all — fp에서 데이터를 스캔하고 포함된 각 uuencoded 파일을 추출합니다.


설명

mailparse_uudecode_all(resource $fp): array

주어진 파일 포인터에서 데이터를 스캔하고 포함된 각 uuencoded 파일을 임시 파일로 추출합니다.


매개변수

fp
A valid file pointer.

반환 값

파일 이름 정보를 나열하는 연관 배열의 배열을 반환합니다.

filename 생성된 임시 파일 이름의 경로
origfilename uuencoded 부분에만 해당하는 원래 파일 이름

첫 번째 파일 이름 항목은 메시지 본문입니다. 다음 항목은 디코딩된 uuencoded 파일입니다.


Examples

예제 #1 mailparse_uudecode_all() 예제

                  
<?php

$text = <<<EOD
To: fred@example.com

hello, this is some text hello.
blah blah blah.

begin 644 test.txt
/=&AI<R!I<R!A('1E<W0*
`
end

EOD;

$fp = tmpfile();
fwrite($fp, $text);

$data = mailparse_uudecode_all($fp);

echo "BODY\n";
readfile($data[0]["filename"]);
echo "UUE ({$data[1]['origfilename']})\n";
readfile($data[1]["filename"]);

// Clean up
unlink($data[0]["filename"]);
unlink($data[1]["filename"]);

?>
                  
                

위의 예는 다음을 출력합니다.

BODY
To: fred@example.com

hello, this is some text hello.
blah blah blah.

UUE (test.txt)
this is a test