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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:07:58+00:00 2026-06-13T11:07:58+00:00

I am trying to manipulate a string so that any quotes () within <a

  • 0

I am trying to manipulate a string so that any quotes (“) within <a href> and <\a> get taken out… Sorry if its been asked before but I just can’t get it to work! By the way, I am POSTing the data from a form and then manipulating the string. This is basically html but its in the form of a string, and I want to take out quotes on things like images and links… Another thing is, I do not want to escape the quotes because that would break the link… And the whole point is that the html can be used and work fine… But now, something is automatically creating a second set of quotes inside the normal quotes, like this: <a href="\"http://www.example.com/\""></a>

Example input would be: <p><a href="http://www.example.com">example</a></p>

Heres how it appears when I echo it however: <p><a href=\"http://www.example.com\">example</a></p>

Heres how I want it to look: <p><a href="http://www.example.com">example</a></p>

So I would actually be trying to get rid of the (/) my bad…

HERES HOW IM USING IT:

I am using a Rich Text Editor to write html, then sending it through a form with post method, but it keeps putting in double quotes… I notice when I edit the source of the RTE and take out all quotes, the link works… But I cant make my users go into the source and do that everytime, so I need a solution that does it automatically…

  • 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-13T11:07:58+00:00Added an answer on June 13, 2026 at 11:07 am

    ok.. so you could try $result = stripslashes($string) or do it with a regular expression like

    $result = preg_replace( '/\\\\(?=")/', '', $string )

    or

    $result = preg_replace( '/\\\\"/', '"', $string ) but better in this case would be $result = str_replace( '\\"', '"', $string )

    edit: this works fine for me

    $input = '<p><a href=\"http://www.example.com\">example</a></p>';
    
    echo htmlspecialchars($input) . '<br/>';
    
    $output = preg_replace( '/\\\\(?=")/', '', $input );
    
    echo htmlspecialchars($output) . '<br/>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple string that I'm trying to manipulate: Your order will be
I am trying to manipulate a string to a format of regexp String months1
I am trying to manipulate a conditional string outputted from SAS into the right
I have a global variable averagel that I am trying to manipulate in a
I'm looking for a good python library to manipulate subversion repositories. I'm trying out
I'm trying to create some classes that allow me to retrieve and manipulate a
I have been asked to build a web application that will be used to
I'm trying to code up an Emacs script that has to manipulate the clipboard
I have a string that I want to extract text between comment tags, manipulate
I'm trying to manipulate the output of Wordpress' the_date() function. My code: <?php define('WP_USE_THEMES',

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.