remove https://www. and https://www. from user website url info
-
I found this:
$input = 'www.google.co.uk/'; // in case scheme relative URI is passed, e.g., //www.google.com/ $input = trim($input, '/'); // If scheme not included, prepend it if (!preg_match('#^http(s)?://#', $input)) { $input = 'https://' . $input; } $urlParts = parse_url($input); // remove www $domain = preg_replace('/^www\./', '', $urlParts['host']); echo $domain; // output: google.co.uk
But where and especially how do I place this, so the URL showing on profiles will be shorter. Example:
https://www.facebook.com/help/notifications > facebook.com/help/notifications
We all know that https:// is back to the 90’s and www is gone in the most browsers, so why showing old URL’s, right?Only the showing URL and not the hardcoded URL ??
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘remove https://www. and https://www. from user website url info’ is closed to new replies.