title: PHP: Get hostname of external website by URL (determine if the hostname includes 'www')
body: <p>Given I have an URL to an external website like `https://www.test.com' or 'https://test.com', but I'm not sure if the hostname of the external website actually includes 'www' or not. How can I determine this using PHP?</p>