SORU
6 Kasım 2012, Salı


Nasıl bir dosya satır okumak için php line

Nasıl tamamen bellekte yüklemeden PHP satırı ile dosya satır okumak?

Dosyamı ben her zaman bellek hatası egzoz var yani bellekte açmak için çok büyük.

Dosya boyutu 1Gb.

CEVAP
6 Kasım 2012, Salı


fgets() dosyayı satır satır okumak için işlevini kullanabilirsiniz:

$handle = fopen("inputfile.txt", "r");
if ($handle) {
    while (($line = fgets($handle)) !== false) {
        // process the line read.
    }

    fclose($handle);
} else {
    // error opening the file.
} 

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:
Php

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • eyes4beautee

    eyes4beautee

    17 HAZİRAN 2011
  • girleffect

    girleffect

    20 Mayıs 2008
  • TheJoeycool2010

    TheJoeycool2

    12 Temmuz 2010