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

  • RomanAtwood

    RomanAtwood

    18 Kasım 2009
  • SignatureSeries

    SignatureSer

    24 Aralık 2006
  • TechnoBuffalo

    TechnoBuffal

    8 HAZİRAN 2007