HTTP Authentication in PHP

I’ve just discovered, totally by accident, how to get HTTP Authentication (when the browser pops up a dialog asking for the username and password - usually set with a .htaccess file) values within PHP. Previously, I’d just