Autor Zpráva
Pospyrus
Profil
Dobrý den a hezké svátky,
mám problém s preg_replace:

z tohoto:

$str="[ URL=http://seznam.cz]Text1[/URL]gfdgdfgd[URL=http://seznam.cz]Text2[ /URL]";
//mezery kvůli BB kódum v této diskusi
$str = preg_replace('/\[url=(.*)\](.*)\[\/url\]/i', '<a href="$1">$2</a>', $str);


to napíše toto:

<a target="_blank" href="http://seznam.cz]Text1[/URL]Text2[URL=http://seznam.cz">Text2</a>

Nevíte co s tim?
Děkuji
blaaablaaa
Profil
$str = preg_replace('/\[url=(.*?)\](.*?)\[\/url\]/i', '<a href="$1">$2</a>', $str);
Alphard
Profil
'/\[url=(.*)\](.*)\[\/url\]/iU'
Pospyrus
Profil
Diky moc, už to jede a co dělá to U?
Alphard
Profil
Pattern Modifiers
Pospyrus
Profil
Diky moc

Vaše odpověď

Mohlo by se hodit


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm:

0