Created
February 23, 2018 15:25
-
-
Save aaronsummers/401b9fc37f34329465e8fff662efc7c6 to your computer and use it in GitHub Desktop.
Checking urls for http
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
<?php | |
/* | |
* CHECK LINKS FOR HTTP | |
*************************************************************/ | |
function addScheme($url, $scheme = 'http://') { | |
return parse_url($url, PHP_URL_SCHEME) === null ? | |
$scheme . $url : $url; | |
} | |
// echo addScheme('this.com'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment