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 6712435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:15:34+00:00 2026-05-26T08:15:34+00:00

I want to encode ( htmlentities ) or disable all tags except for <a>

  • 0

I want to encode (htmlentities) or disable all tags except for <a> tags.

How can I achieve this?

  • 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-05-26T08:15:34+00:00Added an answer on May 26, 2026 at 8:15 am

    After using HTML entities, convert the links back using a RegExp:

    preg_replace('/&lt;(\/?a(?:|\s[\S\s]+?))&gt;/i', '<$1>', $string);
    

    If you want other tags to be removed, use:

    strip_tags($string, '<a>');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to encode/compress some binary image data as a sequence if bits. (This
I want to encode tags that will contain a field number and a wire
I want to base 64 encode uploaded file then save this into Blob type
I want to encode a message...This is the message that i have generated from
I want to encode a .html file (wxString) into hex. I tried to achieve
This should be simple. I have an integer array that I want to encode
I want to encode this 广东路20号外滩5号7楼,近中山东一路 into this: %e5%b9%bf%e4%b8%9c%e8%b7%af%32%30%e5%8f%b7%e5%a4%96%e6%bb%a9%35%e5%8f%b7%37%e6%a5%bc%ef%bc%8c%e8%bf%91%e4%b8%ad%e5%b1%b1%e4%b8%9c%e4%b8%80%e8%b7%af however urlencode() doesn't seem to
I want to encode strings as Python do. Python code is this: def EncodeToUTF(inputstr):
I want to encode DNS protocol header using C and create a UDP datagram.
As the title mentioned, I want to encode a Image Obj into some kind

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.