Source Code:
(back to article)
<?php $url = 'http://www.example.com/path/to/page.html'; $url_parts = parse_url($url); $domain = $url_parts['host']; // Output: "www.example.com" echo $domain;
Result:
Report an issue