Skip to content

Instantly share code, notes, and snippets.

@k1ic
Created June 1, 2015 10:25
Show Gist options
  • Save k1ic/dfa6bdb7f1830b79eb71 to your computer and use it in GitHub Desktop.
Save k1ic/dfa6bdb7f1830b79eb71 to your computer and use it in GitHub Desktop.
判断是否为weibo.com域名下的链接
/* 判断是否为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