if( strpos($url, ‘http://’) === false )
$url = ‘http://’ . $url;
Or if you are a fan of single line functions
$url = ( strpos($url, ‘http://’) === false ) ? ‘http://’ . $url : $url;
if( strpos($url, ‘http://’) === false )
$url = ‘http://’ . $url;
Or if you are a fan of single line functions
$url = ( strpos($url, ‘http://’) === false ) ? ‘http://’ . $url : $url;