Skip to content

Instantly share code, notes, and snippets.

@marcelo-ribeiro
Last active August 29, 2015 14:16
Show Gist options
  • Save marcelo-ribeiro/dde829d3a9703b0c2da9 to your computer and use it in GitHub Desktop.
Save marcelo-ribeiro/dde829d3a9703b0c2da9 to your computer and use it in GitHub Desktop.
function remove_http($url) {
$disallowed = array('http://', 'https://');
foreach($disallowed as $d) {
if(strpos($url, $d) === 0) {
return str_replace($d, '', $url);
}
}
return $url;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment