可能重複從字符串刪除網址:
Strip All Urls From A Mixed String (php)由.COM找到
我需要一種方法來移除VAR URL字符串,但不與找到.
然後將其刪除。沒有,我需要它通過尋找http
和尋找.com
或.net
或.info
然後取出整條鏈路
這裏是我的previoys代碼
function cleaner($url) {
$U = explode(' ',$url);
$W =array();
foreach ($U as $k => $u) {
if (stristr($u,'http') || (count(explode('.',$u)) > 1)) {
unset($U[$k]);
return cleaner(implode(' ',$U));
}
}
return implode(' ',$U);
}
$url = "$first";
而是一個刪除。不.COM
不算什麼我想要兄弟。我需要刪除.com .info等,我不用它來處理它只有點 – user1531557 2012-07-17 12:08:34
也許你可以更新問題,然後,讓你想要的是明確的。即「我有這個字符串,我期待這個輸出,我試過了,我得到了這個」。或者乾脆[閱讀本文和「相關」](http://stackoverflow.com/questions/how-to-ask) – AD7six 2012-07-17 16:20:22