PHP Conference Japan 2024

mailparse_stream_encode

(PECL mailparse >= 0.9.0)

mailparse_stream_encode從來源檔案指標串流資料,套用編碼並寫入 destfp

說明

mailparse_stream_encode(資源 $sourcefp, 資源 $destfp, 字串 $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.

新增註解

使用者貢獻的註解

此頁面沒有使用者貢獻的註解。
To Top