Created
October 10, 2012 07:34
-
-
Save plasticbrain/3863749 to your computer and use it in GitHub Desktop.
PHP: (REGEX/preg_match) check for http(s)://
This file contains hidden or 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
//-------------------------------------------------------------------------- | |
// See if a url contains http:// or https:// | |
//-------------------------------------------------------------------------- | |
if( !preg_match('/http(s?)\:\/\//i', $url) ) { | |
// URL does NOT contain http:// or https:// | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment