Burhan KARADERE Kişisel Blog - Bilgisayar IT Haber - Programlama - Donanım

Hızlı Erişim

Arşiv

Hava Durumu

Sağanak Yağmur 6°C Sağanak Yağmur
Çar Yağmur İhtimali
3/0
Per Kar Yağışı İhtimali
3/-1
Cum Kar Yağışı İhtimali
3/-1

Php ile Dosya Okuma (txt text)

Php ile dosya Okuma (txt text)  Aşağıdaki örneğimizde  root dosyadaki dosya.txt içinin okunması ile ilgili örnek mevcuttur. Fopen fonksiyonu ile dosya açılarak printe fonksiyonu ile satır satır yazdırıyoruz.

<?

/*
$dosya_adi=”dosya.txt”;
if ($dosya=fopen(“$dosya_adi”,’r'))
{
$i=0;
while ($i <= 5) {
$i++;
$satir=fgets($dosya,1024);
print “”.$satir.”<br>”;

}
}
else
print “Dosya açılamadı: “.$dosya_adi;

*/
$dosya = file(“dosya.txt”);
foreach ($dosya as $satsayisi => $satir)
{
}
$hedefsatir = $satsayisi  – 5;

//print $hedefsatir ;

foreach ($dosya as $satsayisi => $satir)
{
if ($hedefsatir==$satsayisi){

print $satir;

}

}
/*
$str = “Hello#world!”;
$bol = spliti(‘#’,$str);

print $bol[1];

*/

?>

VN:F [1.9.13_1145]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.13_1145]
Rating: -1 (from 1 vote)
Php ile Dosya Okuma (txt text), 10.0 out of 10 based on 1 rating

No related posts.

2 comments to Php ile Dosya Okuma (txt text)

  • I’m extremely impressed with your writing skills as well as with the layout on your blog. Is this a paid theme or did you customize it yourself? Either way keep up the excellent quality writing, it is rare to see a great blog like this one today..

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  • Thank you,
    I am used customize modify template.
    it is current theme name Atahualpa . Can you visit http://forum.bytesforall.com/

    Best Regards.

    VN:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.13_1145]
    Rating: 0 (from 0 votes)

Bir Cevap Yazın

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">