built in - Is there a PHP function for retrieving the "first part" of a URL? -


is there php function retrieving "first part" of url, similar how dirname/basename act on file paths?

something along lines of

echo "url_basename('example.com/this_post/12312')" 

which return

example.com 

parse_url should reliably.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -