看板 PHP 關於我們 聯絡資訊
※ 引述《Thomson1014 (努力)》之銘言: : 我想用ereg判斷網址是否符合我的要求 : 1.開頭一定為www(大小寫都可) : 2.www後最多三個結尾 ex:www.yahoo.com.tw : 我的寫法 : if(ereg("^([W|w]{3})+\..+\..+\..$", $http)) : 請問哪裡有錯? : ※ 編輯: Thomson1014 來自: 118.171.203.31 (09/14 10:16) 要不要改用 preg_match if(preg_match('/^www(\\.\\w){0,2}\\.\\w$/i', $http)) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.250.220
Thomson1014 :不好意思,小弟是初學者~有點看不懂意思^^| 09/14 10:39
PHP5 :參考 http://tw2.php.net/manual/en/book.pcre.php 09/14 11:07