Icaros
-
Posts
2 -
Joined
-
Last visited
Never
Posts posted by Icaros
-
-
i've tried using the following to remove double quotes (i'll get to single eventually) from a string that the user can enter, but it's removing the entire word in quotes.
example:
blah blah "blah"
returns:
blah blah
should be:
blah blah blah
$fixcomment = str_replace("\x22", "", $comment);
or
$fixcomment = str_replace("\"", "", $comment);
any ideas?
proper way to strip quotes?
in PHP Coding Help
Posted
//Strip quotes
$fixcomment2 = str_replace('\"', '', $comment);
$comment = $fixcomment2;
$fixcomment2 = str_replace("\'", "", $comment);
$comment = $fixcomment2;
notice that for double quotes, i need to use single quotes (' \" '), but for single quotes i needed to use double (" \' "). it didn't work any other way!