After processing the regulars in a href there are 2 slashes. I can’t write it so that the url correctly formed. If you notice there are 2 slashes, if with one then everything is fine.
$outText = '<p><a href="//trading-conditions/precious-metals/xpd">Palladium</a></p>'; $base_url = 'http://site.com'; $outText = preg_replace("/href\s*=\s*(('(\/[^']*)')|(\"(\/[^\"]*)\"))/ism", 'href="'.$base_url.'$3$5"', $outText); Help please write correctly.
thank