I have the following div:
<div class="divClass">Language:
<a href="http://www.some-site.com/something/something2/">EN</a>
<a href="http://de.some-site.com/something/something2/">DE</a>
<a href="http://es.some-site.com/something/something2/">ES</a>
<a href="http://fr.some-site.com/something/something2/">FR</a>
<a href="http://it.some-site.com/something/something2/">IT</a>
<a href="http://nl.some-site.com/something/something2/">NL</a>
<a href="http://pt.some-site.com/something/something2/">PT</a>
<a href="http://ru.some-site.com/something/something2/">RU</a>
<a href="http://gr.some-site.com/something/something2/">GR</a>
<a href="http://cn.some-site.com/something/something2/">CN</a>
<a href="http://pl.some-site.com/something/something2/">PL</a>
<a href="http://se.some-site.com/something/something2/">SE</a>
</div>
And using this regex pattern:
/<div class="divClass"><a href="(.*)">(.*)<\/a><\/div>/i
To use in the following expression:
$out=preg_replace('/<div class="divClass"><a href="(.*)">(.*)<\/a><\/div>/i',replace_link(substr('$1', strpos('$1','com/')+1),'$2'),$out);
My preg_replace returns NULL. Basically I want to get the link from within the A tag and it's value and replace the links and values with what I get from my replace_link
function.
Any ideea how to do that?
Thank you!