Jump to content

reading file


csckid

Recommended Posts

Change your code to

$contents = file_get_contents('mydata.txt');

echo '<pre>' . $contents . '</pre>';

 

The reason why your spaces are not showing is because web browsers ignore any whitespace. I added the pre tags which forces the browser to display the spaces.

 

Link to comment
https://forums.phpfreaks.com/topic/182809-reading-file/#findComment-964911
Share on other sites

thanks..

 

can you give me an idea.....

I am actually reading a large file and inserting the content in database

 

the file looks like this

1. myname          12                              23

2. myname2                                          42

3. myname3        14                              34

4. myname4        21                           

In 2nd and 4th row one of the content is not present. How will I detect that?

 

Link to comment
https://forums.phpfreaks.com/topic/182809-reading-file/#findComment-964922
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.