Last active
June 28, 2017 21:04
-
-
Save thagxt/0f35a0682ed76ca73c342c64cc96619b to your computer and use it in GitHub Desktop.
Remove both http:// & https:// from URL
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 | |
$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