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

  • Google Developers

    Google Devel

    23 AĞUSTOS 2007
  • hockeywebcasts

    hockeywebcas

    31 EKİM 2012
  • Munchkin the Teddy Bear

    Munchkin the

    30 EYLÜL 2011