I want to replace
<img src="<?php echo($...); ?>"
with
<img src="<?php echo(htmlentities($...)); ?>"
...are any characters here.
Could someone help me with a regular expression script to do this work?
Basically, I want to apply htmlentities to the image source name. Although, when in my code when these images uploaded, I already checked the validation of the image name which only allow English letters and numbers, plus -_ and dot.
Here is my script
Find: <img src="<?php echo($(.) ); ?>"
replace <img src="<?php echo(htmlentities($(.) )); ?>"
I used escape on ( and ), do I need to use escape on other characters in my script? And try to use this in dreameaver find/replace with regular expression. I cannot find the codes I was looking for to replace.
By the way, if I already have the codes to check the image name validation when I upload them, and now I am trying to apply htmlentities on the image name in the src="", is this redundancy good or bad?
Thanks!