-
-
Save Alexander-Pop/671669d08b2c1a0ee0f0a34ff25ebc0b to your computer and use it in GitHub Desktop.
Remove both http:// & https:// from URL #php
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