Page 1 of 1

How to remove / when using an apostrophe

Posted: Mon Jul 29, 2002 1:21 pm
by Fluxcore
I have a program that people enter some text and its printed on the screen when they hit enter. Any time they use an apostrophe, I get something like this.

I talk alot, don''t I? The question mark is my favorite punctuation mark, isn''t it?


How do I get rid of the \???

Posted: Mon Jul 29, 2002 1:29 pm
by Shadough
stripslashes() will work.

eg: stripslashes($txt);

Posted: Tue Jul 30, 2002 1:40 am
by twigletmac
You could also turn off magic_quotes_gpc in your php.ini.

Mac

Posted: Tue Jul 30, 2002 5:16 am
by hob_goblin
i'd stick with stripslashes

Code: Select all

<?

if($_POST&#1111;'action'] == "go")&#123;
 echo stripslashes($_POST&#1111;'input']);
&#125; else &#123;
?>
<form method="post">
 <input type="text" name="input" /><br />
 <input type="hidden" name="action" value="go" />
 <input type="submit" />
</form>
<?
&#125;
?>