How to manipulate string to delete quotes?

Posted by user1751581 on Stack Overflow See other posts from Stack Overflow or by user1751581
Published on 2012-10-27T10:06:24Z Indexed on 2012/10/27 11:01 UTC
Read the original article Hit count: 153

Filed under:
|
|
|
|

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...

© Stack Overflow or respective owner

Related posts about php

Related posts about html