Skip to content

Instantly share code, notes, and snippets.

@Alexander-Pop
Forked from thagxt/strip-https
Last active February 1, 2019 16:53
Show Gist options
  • Save Alexander-Pop/671669d08b2c1a0ee0f0a34ff25ebc0b to your computer and use it in GitHub Desktop.
Save Alexander-Pop/671669d08b2c1a0ee0f0a34ff25ebc0b to your computer and use it in GitHub Desktop.
Remove both http:// & https:// from URL #php
<?php
$url = "https://example.com/";
$url = preg_replace('/^https?:\/\//', '', $url);
// output: example.com/
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment