精華區beta PHP 關於我們 聯絡資訊
那就來個正經的 =___= $content=ereg_Replace("((http[s]?)|(ftp)|(telnet)|(gopher))+://[^<>[:space:]]+[[:alnum:]/]","<a href=\"\\0\" target=_blank>\\0</a>", $content); ※ 引述《htk (我要降二軍啦!!!!!!!!)》之銘言: : 想應用在留言板上 : ex: $str = "你可以到以下網址去查: http://tw.yahoo.com"; : 如何自動偵測到字串中有網址 : 然後用什麼函數可以把 $str 變成 : "你可以到以下網址去查: <a href=http://tw.yahoo.com>http://tw.yahoo.com</a>" : 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 163.13.12.35
htk:成功了~~~ 太神奇了~~~ 感謝感謝!!! <(_ _)> 10/04 18:39