..ho risolto in altro modo..
provo il tuo, magari succhia meno risorse..
Codice PHP:
$stringhe = explode("\n", $variabile);
$righe = count($stringhe);
trim ($stringhe);
for ($i=0; $i<=$righe; $i++) {
$stringhe[$i] = str_replace("\r", "", $stringhe[$i]);
@$pos = strpos($stringhe[$i],"/",10 );
$link[$i] = $stringhe[$i];
$stringhe[$i] = substr($stringhe[$i],0,$pos);
echo '[url="' . $link[$i] . '"]' . $stringhe[$i] . '[/url]
';
}