SORU
28 Mayıs 2011, CUMARTESİ


Txt her satırı yeni bir dizi öğe için dosya okumak

Bir diziye bir metin dosyasının her satırı okumak ve yeni bir öğe her satır için çalışıyorum.
Benim kod şimdiye kadar.

<?php
$file = fopen("members.txt", "r");
$i = 0;
while (!feof($file)) {

$line_of_text = fgets($file);
$members = explode('\n', $line_of_text);
fclose($file);

?>

CEVAP
28 Mayıs 2011, CUMARTESİ


Eğer herhangi bir özel işleme gerek yok eğer doğru değilse, this aradığınız şeyi yapmalı

$lines = file($filename, FILE_IGNORE_NEW_LINES);

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

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Good Creative Academy

    Good Creativ

    19 Kasım 2009
  • Myron and Nejusha dance

    Myron and Ne

    2 AĞUSTOS 2012
  • Richard Laxa

    Richard Laxa

    30 AĞUSTOS 2012