Last active
November 5, 2016 09:55
-
-
Save akamola/7c94ace522508adb60e6468147523a05 to your computer and use it in GitHub Desktop.
PHP: Check if a URL does not contain "http://" or "https://"
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 | |
if ( ( strpos( $url, 'http://' ) === false ) && ( strpos( $url, 'https://' ) === false ) ) { | |
$url = 'http://' . $url; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment