Jump to content

Run function on parts of text string


wee493

Recommended Posts

Currently I have a large string of html stored in a variable. Within the html is some images.I'm using preg_replace to find all the images

$content = preg_replace('~'.$site.'(\S+\.(?:jpe?g|png|gif))~i', "$1",$content);

 

I'm wanting to run a function on every image to cache it locally. So I need to run a function on each string preg_replace picks out. How do i do this?

Link to comment
https://forums.phpfreaks.com/topic/181483-run-function-on-parts-of-text-string/
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.