Jump to content

Recommended Posts

I have a row in my sql I had to remove quotes from a href links to import it into my database because it was a csv file and delimiters were quote so I made a script to remove them. But I made a script to remove them:

 

$file = file_get_contents('ibf_forums.csv');
$file = str_replace('="','=^69^',$file);
$file = str_replace('\"','\^69^',$file);
$file = str_replace('"\ ','\^69^',$file);

 

Now I need to put them back in. So I need to replace ^69^ in a database. If I use UPDATE it will over write it all without replace just a part of it. An example if I don't make sense:

 

Thanks&#33; <img src=\^69^http://domain.com/style_emoticons/<#EMO_DIR#>/tongue.gif\^69^ style=\^69^vertical-align:middle\^69^ emoid=\^69^\^69^ border=\^69^0\^69^ alt=\^69^tongue.gif\^69^ />

Into this:

Thanks&#33; <img src=\"http://domain.com/style_emoticons/<#EMO_DIR#>/tongue.gif\" style=\"vertical-align:middle\" emoid=\"\" border=\"0\" alt=\"tongue.gif\" />

Link to comment
https://forums.phpfreaks.com/topic/210170-mysqlstr_replace/
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.