I have a string like
$str="<a href='https://www.google.com'>Google</a>Test url
<a href='https://www.twitter.com'>Twitter</a>Sample content
<a href='example.com'>Example</a>.....
...................................";
I want to replace the urls in the hyperlink like as follows,
$result="<a href='http://my_url.com/https://www.google.com'>Google</a>Test url
<a href='http://my_url.com/https://www.twitter.com'>Twitter</a>Sample content
<a href='http://my_url.com/example.com'>Example</a>
..................................................
...............................";
I mean,Every url will be a segment of my web url.Is possible with a preg_replace(),Please help me