Potresti usare le PCRE per il tuo problema. Dai un occhiata qui http://it.php.net/manual/en/book.pcre.php
Ecco un esempio:
Edit: Puoi salvare i tuoi link come se fossero testo normale, basta che il valore di $str sia il testo del tuo blog. Poi lo script ricercherà i link e li strasformerà nel modo opportuno.codice:<?php $str = "Vai su www.sotto.sottodominio.dominio.ext oppure www.dominio.ext"; preg_match_all('@(http://)?(([a-zA-Z0-9]+)\.)+([a-zA-Z0-9]+)@',$str, $mtc); $mtc = $mtc[0]; foreach ($mtc as $chiave=>$valore) { (substr($valore, 0,7) == "http://") ? $str =str_replace ($valore, ''.$valore.'', $str) : $str =str_replace ($valore, ''.$valore.'', $str); } echo $str; ?>