How to remove / when using an apostrophe

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Fluxcore
Forum Newbie
Posts: 3
Joined: Sun Jul 28, 2002 11:56 am
Location: Mi.
Contact:

How to remove / when using an apostrophe

Post 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 \???
Shadough
Forum Newbie
Posts: 20
Joined: Tue Jun 04, 2002 9:11 pm

Post by Shadough »

stripslashes() will work.

eg: stripslashes($txt);
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

You could also turn off magic_quotes_gpc in your php.ini.

Mac
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post 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;
?>
Post Reply