how to cancel auto escape of single quotes

Posted on 2001-08-06
Last Modified: 2012-06-27
hi everybody

I am creating html page using the messages given by user in form. As we know the php program automatically replaces single quotes (') in user message with /' and when i display it in browser,it only prints '

Yes of course it is nice feature but when I tried to write this user message in my html it writes /' instead of '.

How to solve this problem. Please help me.

Question by:epdass
LVL 40

Accepted Solution

Richard Quadling earned 50 total points
ID: 6355305
echo stripslashes($textvariable);

might be what you are looking for.

From the PHP Manual.

(PHP 3, PHP 4 )

stripslashes --  Un-quote string quoted with addslashes()

string stripslashes (string str)

Returns a string with backslashes stripped off. (\' becomes ' and so on.) Double backslashes are made into a single backslash.

See also addslashes().


Richard Quadling.

Expert Comment

ID: 6358527
Or look in your php.ini for the magic quotes directives.


Expert Comment

ID: 6358529
Also, whether php quotes automatically is a configuration option (magic_quotes_gpc), so you may also set it to 0 in your ini file, or with ini_set


Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How do I remove all except the numbers?  PHP  Regex 3 27
Why do people dis php? 5 47
ignore other .htaccess 2 43
Google Maps API and PHP 25 27
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question