[QUOTE]Originariamente inviato da nyo89
Sicuramente c'č di meglio, ma potresti provare cosė:
Codice PHP:
$testo = str_replace('[URL="', '<a href="', $testo);
$testo = str_replace(']', '" target="_blank">', $testo);
$testo = str_replace('[/URL]', '</a>', $testo);
echo $testo;
[/PHP] [/QUOTE]
Nella prima riga un " di troppo
[PHP]
Corretta:
$testo = str_replace("[URL=", '<a href="', $testo);
[/PHP]
non funziona....
[PHP]
mi restituisce:
// <a href="http://forum.html.it" target="_blank">forum.html.it[/URL" target="_blank">
[/PHP]
credo sia dovuto dalla quadra [ (II riga del tuo script)
Altri sviluppi
Cambiando l' ordine dei fattori il prodotto cambia...
unico problema č che se nel testo č presente una quadra ] viene sostituita con
" target="_blank">
[PHP]
$testo = str_replace("[URL=", '<a href="', $testo);
$testo = str_replace("[/URL]", "</a>", $testo);
$testo = str_replace("]", '" target="_blank">', $testo);
echo $testo;
cichity74