Created
June 1, 2015 10:25
-
-
Save k1ic/dfa6bdb7f1830b79eb71 to your computer and use it in GitHub Desktop.
判断是否为weibo.com域名下的链接
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 判断是否为weibo.com域名下的链接 | |
* @return bool | |
*/ | |
public static function isWeiboDomain($url) | |
{ | |
if (empty($url)) return false; | |
return preg_match('/^https?:\/\/([^\.]+\.){0,5}weibo\.com(\/.*)?$/i', trim($url)) > 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment