Snippets
How to get a domain name from the URL
Hi,
If you want to get the domain name from a url, this snippet might be helpful for you.
$url = 'http://laravel-school.com/posts/understanding-autoload-and-namespace-in-php-57';
$parse = parse_url($url);
echo $parse['host']; // prints 'laravel-school.com'
Thank you.