Going through a txt file
Could someone please show me a small example of how to go through every line of a txt file and to show the information for each line. Alls I need is the code to go through the txt file
The best way to show line per line the contents of a file is using the file(); function which returns an array where each element of this array contains a line of the file.
You can also use int readfile(string file); to read and print out the whole content of the file which is better is you just want to write out the whole textfile rather than doing line per line manipulation. (It returns the number of characters read.)
|All times are GMT +1. The time now is 02:30 PM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.