Skip to content

Instantly share code, notes, and snippets.

@akamola

akamola/checkurl.php

Last active Nov 5, 2016
Embed
What would you like to do?
PHP: Check if a URL does not contain "http://" or "https://"
<?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
You can’t perform that action at this time.