What I want to do is run a function on the src of HTML image tags inside of the replace, function for the sake of argument called do_this().
[code=php]
$preg_find[] = ‘#<img([^<>].*)src=”(.*)”([^<>].*)/>#eiU’;
$preg_replace[] = “html_entity_decode(convertImage(\2))”;
$output = preg_replace($preg_find, $preg_replace, $output;
I know the replace will bork the HTML output, I’m just trying to get it to run the function without failing on a simple version first. No matter what combination of anything I try, it’s producing a wide variety of errors. Current error for the above version is:
Parse error: syntax error, unexpected ‘:’ in functions.php(706) : regexp code on line 1
Fatal error: preg_replace(): Failed evaluating code: html_entity_decode(convertImage(image.jpg)) in /var/www/html/includes/functions.php on line 706
Very grateful for any help. ? Thank you!