看板 PHP 關於我們 聯絡資訊
以下為一個亂打的網址 http://tw.yahoo.com?http://www.google.com.tw|660|440 現在我想要取得第二個 http開始 到.tw結束 正規表示法該怎麼寫呢? 請大家指導一下 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 123.240.54.58 ※ 編輯: deathfullove 來自: 123.240.54.58 (06/10 23:52)
yanli2:可能找不到第二個hppt 06/11 00:04
tails32100:hppt XD 06/11 00:05
※ 編輯: deathfullove 來自: 123.240.54.58 (06/11 00:06)
deathfullove:那改成url = "http://www.google.com|660|440" 06/11 00:09
deathfullove:要取得 http://www.google.com 要怎麼表示 06/11 00:09
deathfullove:網址跟數字是隨機跳動的 只有|660|440 的"|"是固定 06/11 00:10
water2924:http://tinyurl.com/ld4ty6m 06/11 00:12
clifflu:$regex = '/^(http:\/\/[\w\d\\\.\?\-_=%#&]+)\|/'; 06/11 01:21