// taking your stated requirement literally:
$link = '<a href="http://www.somewhere.com/xxx/yyy.html">Go here</a>';
$link = preg_replace( "{<a href=\".*\">}", "<a href=\"/\">", $link );
echo $link; // prints <a href="/">Go here</a>
To replace the just the domain name www.somewhere.com with /, use str_replace as 100110 stated earlier.