html_entity_decode

  • Unescaping a string that has been escaped for HTML can be done using the CGI.unescapeHTML class method.

    PHP

    $result = html_entity_decode("test "unescaping" <characters>"); 
    var_export($result);
    // => 'test "escaping" <characters>'

    Ruby

    require 'cgi'
     
    p CGI.unescapeHTML("test &quot;unescaping&quot; &lt;characters&gt;")
    # => "test \"unescaping\" <characters>"

    see also

Looking for Rails or PHP web application development, integration, and training?

Rails for PHP is brought to you by Maintainable Software. Get custom web applications and personalized training from the authors of the book and website.