mailparse_stream_encode
ソースファイルポインタからストリームデータを取得し、
エンコーディングを適用し、出力ファイルポインタに書き込む
説明
bool mailparse_stream_encode(resource $sourcefp, resource $destfp, string $encoding)
ソースファイルポインタからストリームデータを取得し、
encoding を適用して
それを出力ファイルポインタに書き込みます。
パラメータ
-
sourcefp
-
有効なファイルハンドル。このファイルからのストリームがパーサに流し込まれます。
-
destfp
-
エンコードしたデータを書き込むファイルハンドル。
-
encoding
-
mbstring
モジュールがサポートする文字エンコーディングのいずれか。
戻り値
成功した場合に true を、失敗した場合に false を返します。
例
例1 mailparse_stream_encode の例
<?php
// email.eml の中身は: hello, this is some text=hello.
$fp = fopen('email.eml', 'r');
$dest = tmpfile();
mailparse_stream_encode($fp, $dest, "quoted-printable");
rewind($dest);
// ファイルの内容を表示します
fpassthru($dest);
?>
hello, this is some text=3Dhello.