Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.