Skip to content

Instantly share code, notes, and snippets.

@aaronsummers
Created February 23, 2018 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronsummers/401b9fc37f34329465e8fff662efc7c6 to your computer and use it in GitHub Desktop.
Save aaronsummers/401b9fc37f34329465e8fff662efc7c6 to your computer and use it in GitHub Desktop.
Checking urls for http
<?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