phpbar.de logo

Mailinglisten-Archive

[php] RegEx Replace

[php] RegEx Replace

Sebastian Mendel lists at sebastianmendel.de
Die Okt 11 12:53:01 CEST 2005


thomas.hausheer at bluewin.ch wrote:
> Guten Tag
> 
> warum geht $1 nicht?
> 
> preg_replace('/http?:\/\/([^ $])+/i', '<a href=">$1</a>',$a)

wozu das '?', was willst du genau erreichen?


preg_replace('°http:\/\/([^ $])+°i', '<a href="$0">$1</a>', $a);


-- 
Sebastian Mendel

www.sebastianmendel.de
www.sf.net/projects/phpdatetime | www.sf.net/projects/phptimesheet

php::bar PHP Wiki   -   Listenarchive