Languages :: PHP :: how to read a text file and echo its contents in PHP ? |
|||
| By: Nono |
Date: 24/03/2008 10:14:55 |
Points: 20 | Status: Answered Quality : Excellent |
| how to read a text file and echo its contents in PHP ? | |||
| By: VGR | Date: 24/03/2008 10:28:09 | Type : Answer |
|
| hello, this is very easy. You've a readfile() function available in PHP. It outputs the contents (unless youob_start() beforehand, of course).To get the file, row by row [on CRLF], in an array, you've the file() functionand to get is as a loooong string in a single variable, you've the function file_get_contents() and of course, finally, to read it row by row, you would use the standard C functions fopen(), fgets() and fclose() that's all ;-) I only RTFM :D |
|||
| By: sweet_aris08 | Date: 06/07/2009 15:17:00 | Type : Comment |
|
| file_get_contents() | |||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








