pippin418
03-21-2010, 08:57 AM
So. If I type:
The quick brown fox was too freakin' lazy to jump over the lazy dog.
I get:
The quick brown fox was too freakin\' lazy to jump over the lazy dog.
(I know the new PHP stops this, but I can't upgrade)
So if I use the command to remove slashes I get rid of all slashes (which I don't want to do), so I tried str_replace
$str3 = array("\\"", "\\'", "\\\");
$str4 = array("", "", "");
$str = str_replace($str3,$str4,$_POST['str']);
But that obviously didn't work. So how would I replace \" or \' or \\ with nothing?
(in the php above, it removed my single quote thing. it looked like this without and spaces: \ \ ' )
The quick brown fox was too freakin' lazy to jump over the lazy dog.
I get:
The quick brown fox was too freakin\' lazy to jump over the lazy dog.
(I know the new PHP stops this, but I can't upgrade)
So if I use the command to remove slashes I get rid of all slashes (which I don't want to do), so I tried str_replace
$str3 = array("\\"", "\\'", "\\\");
$str4 = array("", "", "");
$str = str_replace($str3,$str4,$_POST['str']);
But that obviously didn't work. So how would I replace \" or \' or \\ with nothing?
(in the php above, it removed my single quote thing. it looked like this without and spaces: \ \ ' )