4
我使用PHP中的的preg_replace功能,我試圖替換用戶提交與bit.ly縮短網址鏈接:如何使用preg_replace獲取替換的文本?
$comment = preg_replace('/(http|ftp)+(s)?:(\/\/)((\w|\.)+)(\/)?(\S+)?/i', '', $strText);
這將只顯示註釋,「消滅」的網址。問題是如何從文本中獲取URL並在稍後添加它?從php.net