PHP dosyası() İşlev
❮ PHP Dosya Sistemi ReferansıÖrnek
Bir diziye bir dosya okuyun:
<?php
print_r(file("test.txt"));
?>
Tanım ve Kullanım
file() bir dosyayı bir diziye okur.
Her dizi öğesi, dosyadan yeni satır karakteri hala eklenmiş olarak bir satır içerir.
Sözdizimi
file(filename, flag, context)
Parametre Değerleri
Parameter | Description |
---|---|
filename | Required. Specifies the path to the file to read |
flag |
Optional. Can be one or more of the following constants:
|
context | Optional. Specifies the context of the file handle. Context is a set of options that can modify the behavior of a stream. Can be skipped by using NULL. |
Teknik detaylar
Geri dönüş değeri: | Bir dizideki tüm dosya, hata durumunda FALSE |
---|---|
PHP Sürümü: | 4.0+ |
İkili Kasa: | Evet, PHP 4.3'te |
❮ PHP Dosya Sistemi Referansı