Jump to content

extracting details between tags from content


rocklee

Recommended Posts

Hi, I'm currently using str_replace to parse through my content to replace IMG tags with HTML codes <IMG src....>. An example code is as followed :

 

$content = str_replace("[img]http://", "<img WIDTH=480 class='image_center'  src='", $content);
$content = str_replace("[/img]", "'>", $content);

 

 

$content is a bunch of text that contains tags, it may have a number of IMG tags, which is why I use str_replace to quickly browse through it and replace them for HTML output.

 

This works fine but I want to get the URL address of my images and use them as a link as well. I can't do it with this set up because it only replaces the tags, i want to get the url between the tags.

 

Any ideas?

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.