Jump to content

str_replace problem


Harley1979

Recommended Posts

Hi, got a problem here I can't for the life of me understand.

 

Basically I have a form to submit a piece of news and I want to search for all instances of a href and add to that a "rel" attribute.

 

Here is the code below

 

$item = trim($_REQUEST['elm1']);
$item = str_replace('<a href="http', '<a rel="external" href="http', $item);

 

Any ideas anyone why that wouldn't work?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/128274-str_replace-problem/
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.