Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7962697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:24:36+00:00 2026-06-04T05:24:36+00:00

This is simple question but I am a newbie so please forgive my simple

  • 0

This is simple question but I am a newbie so please forgive my simple question.

Is there an easy way to reverse the effects of the FILTER_SANITIZE_SPECIAL_CHARS filter? If not how would you reverse it. Please don’t just say regular expressions, actually suggest how. To be clear I am not looking to reverse the string.

Here is some sample code to help explain what I want to do:

/*** a string with tags ***/
$string = "<li><script>!@#$%^&*\n\'#foo</script><br><p /><li />";

/*** sanitize the string ***/
$x = filter_var($string, FILTER_SANITIZE_SPECIAL_CHARS);
echo $x . "<br>\n";

/*** I want this to output <li><script>!@#$%^&*\n\'#foo</script><br><p /><li /> ***/
echo htmlspecialchars_decode($x);
/*** instead it outputs: &#60;li&#62;&#60;script&#62;!@#$%^&#38;*&#10;\&#39;#foo&#60;/script&#62;&#60;br&#62;&#60;p /&#62;&#60;li /&#62; ***/

All ideas will be appreciated. Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T05:24:38+00:00Added an answer on June 4, 2026 at 5:24 am

    Consider html_entity_decode(), a more comprehensive version of htmlspecialchars_decode().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This might be a simple question but I'm just picking this up so please
This may be very simple question,But please help me. i wanted to know what
I'm sure that this is a simple newbie question, but the answer is eluding
I'm a newbie with PHP so this might be ridiculously easy question, but despite
I realize this is a newbie question, but I'm looking for a simple solution.
I'm not exactly a lisp expert, so please forgive a fairly newbie question. I'm
This might be a pretty simple question but I'm a Crystal Reports newbie...I have
I apologize for this newbie question, but I'm looking for a simple solution. I
I'm sure this is a very simple question, but I'm just a newbie so...
This is possibly a newbie question, but I'm not sure what terms to search

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.