Jump to content

Millions of slashes


flyhoney

Recommended Posts

It's just text, and I guess magic quotes is on and there is some addslashes going on and it is causing data that is edited and saved to slowly accumulate more and more slashes.

 

Stuff like this:

 

This is a silly slashy sentence, isn\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'t it?

Link to comment
https://forums.phpfreaks.com/topic/123456-millions-of-slashes/#findComment-637616
Share on other sites

here it is your code

 

$text = "This is a silly slashy sentence, isn\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'t it?";
$replace = str_replace ( "\\", "" ,$text);
echo $replace;

 

btw you have a problem when you update a value into database it do escape ' to \' ;)

show the update part and you dont need to replace and have those creepy slashes anymore  ::)

Link to comment
https://forums.phpfreaks.com/topic/123456-millions-of-slashes/#findComment-637622
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.