I would like to change
src= test.html to src=/path/test.html
src="test.html" to src="/path/test.html"
I am doing like this:
$pattern = '/src=("|)(.+?)("| )/i';
$replace[0] = "src=\"$path\2\"";
print preg_replace($pattern,$replace,$string);
What should I do if I want
src=http://test.html
src="http://test.html"
remain unchanged ?
😕