Jump to content

Ignore a href link within a function?


Mr Chris

Recommended Posts

Hello,

 

I have a funtion which I run on a string to convert characters to their html eqivalent like so:

 

$string = cleanInput("There's a big bad woolf"); //There& #38 ;s a big bad woolf

 

Now this works great, but say I had the string

 

$string = cleanInput("There's a big bad woolf here <a href=\"click.php\">here</a>"); 

 

That would convert the " to the html equavalent as well.  How could I get around this please and say anywhere there is a <a href> link use the cleanInput function but anywhere else in the text string do?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/204203-ignore-a-href-link-within-a-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.