PHP Conference Japan 2024

recode_file

(PHP 4, PHP 5, PHP 7 < 7.4.0)

recode_file根據重新編碼請求,將檔案重新編碼

說明

recode_file(字串 $request, 資源 $input, 資源 $output): 布林值

根據重新編碼 請求,將檔案控制代碼 input 參考的檔案重新編碼到檔案控制代碼 output 參考的檔案中。

參數

request

所需的重新編碼請求類型

input

input 的本地檔案控制代碼 資源

output

用於 output 的本地檔案控制代碼 資源

回傳值

如果無法執行,則返回 false,否則返回 true

範例

範例 #1 基本的 recode_file() 範例

<?php
$input
= fopen('input.txt', 'r');
$output = fopen('output.txt', 'w');
recode_file("us..flat", $input, $output);
?>

注意事項

此函式目前不處理參照遠端檔案(URL)的檔案控制代碼。兩個檔案控制代碼都必須參照本地檔案。

參見

新增筆記

使用者提供的筆記

此頁面沒有使用者提供的筆記。
To Top