array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'function.mailparse-stream-encode.php', 1 => 'mailparse_stream_encode', ), 'up' => array ( 0 => 'ref.mailparse.php', 1 => 'Mailparse 関数', ), 'prev' => array ( 0 => 'function.mailparse-rfc822-parse-addresses.php', 1 => 'mailparse_rfc822_parse_addresses', ), 'next' => array ( 0 => 'function.mailparse-uudecode-all.php', 1 => 'mailparse_uudecode_all', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ja', 'path' => 'reference/mailparse/functions/mailparse-stream-encode.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL mailparse >= 0.9.0)
mailparse_stream_encode — ソースファイルポインタからストリームデータを取得し、 エンコーディングを適用し、出力ファイルポインタに書き込む
ソースファイルポインタからストリームデータを取得し、
encoding
を適用して
それを出力ファイルポインタに書き込みます。
sourcefp
有効なファイルハンドル。このファイルからのストリームがパーサに流し込まれます。
destfp
エンコードしたデータを書き込むファイルハンドル。
encoding
mbstring モジュールがサポートする文字エンコーディングのいずれか。
例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.