I have facing a problem. Kindly help
I have a Regular expression
Code: Select all
$pattern = '!<img src="([^"]+)"!';
Becoz according to my requirement i have to change the default path found in <img> tag.
Here is another regular expression
Code: Select all
$replace = '<img src=images/'."$1";
Suppose, i have an html file, in that html file there are two <img> tags and those have
these paths like
Code: Select all
<img src = "abc/first_pic.jpg">
Code: Select all
<img src = "admin/img/picture.jpg>"
and
"admin/img/picture.jpg" to "images/picture.jpg"
Means in every requirement i use this path i.e. 'images/anypicturefile.jpg'
For that purpose i must change my current regular expression which is
$replace = '<img src=images/'."$1";
Can anybody help me to change this regular expression $replace = '<img src=images/'."$1";
,so that it fullfills the above requirement