Jump to content

Recommended Posts

I have a quick question about this.  My data in a file looks like this:

 

"2 4 .98 .09"

"4 4 .50 .40"

 

The format is store#, dept it, goal, actual.

What I need to do is read this data from a text file into my database but I do not know how to remove the " marks from the file.  How do I go about doing this?  Can I use add or strip slashes somehow?

 

thanks in advance,

VTS

addslashes adds slashes in front of quotes it doesn't remove quotes. strip slashes reverses what addslashes does and that remove the slashes added to the quotes.

 

What you will want to do is use str_replace instead. To remove the quotes.

 

 $str = '"2 4 .98 .09"';

$str = str_replace('"', '', $str);

echo $str;

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.