I am looking for a way to replace all the occurrences of specific word inside a pattern:
for example:
I love my dog <a>the dog is a good dog, -dog and dog: also should be converted</a>
with
I love my dog <a>the pig is a good pig, -pig and pig: also should be converted</a>
all the occurrences of dog inside the <a>
tag should be replaced with pig.
I had tied the next preg_replece:
preg_replace("/<a>.*(dog).*</a>/", "pig", $input_lines);
but I got empty string..
I would thankful for some help.