How do I unescape quotes?

Posted on 2011-05-02
Last Modified: 2012-06-22
Is there a function that will sanitize posts so the silly &quot will get turned back into real quotes?

\"This should be properly quoted.\"

Open in new window

Question by:DrDamnit
    LVL 9

    Accepted Solution

    If you're only reversing one...

    $string="\"This should be properly quoted.\"";


    $string="\"This should be properly quoted.\"";

    The latter will do more than just "
    LVL 32

    Author Comment

    I was hoping there was a function that would do all the random escapings...
    LVL 9

    Expert Comment

    You can also use stripslashes(), but that'll remove all escaped characters, not just \&
    LVL 48

    Expert Comment

    You could try:

    echo html_entity_decode(stripslashes("\"This should be properly quoted.\""));

    Open in new window

    LVL 32

    Author Closing Comment

    Not what I was hoping for, but what I was hoping for doesn't exist. :-)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    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 count occurrences of each item in an array.

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now