codice: <? $stringa = "http://www.test.it <a href=http://www.test.it>a</a>"; $stringa = preg_replace('#[^href=](http://)([^\s]*)#', '\\1\\2', $stringa); echo $stringa; ?> Ho provato a fare così ma mi omette si di modificare la 2° che non necessita, ma tralascia anche la prima... qualche idea?
<? $stringa = "http://www.test.it <a href=http://www.test.it>a</a>"; $stringa = preg_replace('#[^href=](http://)([^\s]*)#', '\\1\\2', $stringa); echo $stringa; ?>
Regole del Forum