CakeFest 2024: The Official CakePHP Conference

recode_file

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

recode_fileDosyadan dosyaya karakter kodlaması dönüşümü yapar

Açıklama

recode_file(string $istek, resource $girdi, resource $çıktı): bool

Belirtilen isteğe bağlı olarak dosya tanıtıcısı girdi ile belirtilen dosyayı dosya tanıtıcısı çıktı ile belirtilen dosyaya yeniden kodlar.

Bağımsız Değişkenler

istek

Yeniden kodlama isteği türü.

girdi

Girdi olarak bir yerel dosya tanıtıcısı.

çıktı

Çıktı olarak bir yerel dosya tanıtıcısı.

Dönen Değerler

İşlemi başaramazsa false, aksi takdirde true döner.

Örnekler

Örnek 1 - Basit bir recode_file() örneği

<?php
$input
= fopen('girdi.txt', 'r');
$output = fopen('çıktı.txt', 'w');
recode_file("ISO-8859-9..UTF-8", $input, $output);
?>

Notlar

Bu işlev henüz uzak dosyaların (URL) dosya tanıtıcıları ile çalışmamaktadır. Her iki dosya tanıtıcı da yerel olmak zorundadır.

Ayrıca Bakınız

  • fopen() - Bir dosya veya URL'yi açar

add a note

User Contributed Notes 1 note

up
1
martin dot smeeckaert at gmail dot com
10 years ago
The recode_file function will put the file position indicator at the end of each files, so if you want to re-use the handles use fseek beforehand.
To Top