Facebook Twitter Reset

This Tutorial Has Been Viewed 3,163 Times.

Reading file using php

Simple php code for reading lines
Using the below PHP code you can easily read a txt file
< ?php
$file = fopen("mistonline.in.txt", "r") or exit("Unable to open file!");
//Output of the text file
while(!feof($file))
  {
//<br> is used to break b/w lines

  echo fgets($file). "<br />";
  }
fclose($file);
?>

VN:F [1.9.13_1145]
Rating: 8.4/10 (7 votes cast)
VN:F [1.9.13_1145]
Rating: +2 (from 4 votes)
Reading file using php, 8.4 out of 10 based on 7 ratings

Incoming search terms:




You will also be interested in ,

3 Responses to “Reading file using php”

  1. March 17, 2009 at 3:31 pm #

    nice

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: -1 (from 1 vote)
  2. May 7, 2009 at 8:09 am #

    wow, but how about if i want to read the file and add some record without any loss of data,..? thanks in advance

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: -1 (from 1 vote)
  3. May 7, 2009 at 7:41 pm #

    Jeremy thanks again for your response
    Follow this link, it will be helpful and will clear your doubt i guess.

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

Leave a Comment

Spam protection by WP Captcha-Free

Affordable Seo PackagesSeo BlogEdu Backlinks
More in Ajax (4 of 5 articles)