I know you said you read the manual, but for your first question, all of the answers are in the string section in the PHP manual. Look into using str_replace to replace the "_" into a space, and then there is a function called ucwords(), I think, that caps the first letter of each word in a string.
As for your second question, load create a page called info.php and put this in it:
<? phpinfo(); ?>
That's it, nothing else. Load up that page in your browser and look for a variable that has what you're looking for. I think HTTP_HOST or SERVER_NAME will work for you. I think you access those through the $GLOBALS[] array... $GLOBALS["HTTP_HOST"] or $GLOBALS["SERVER_NAME"]...
Have fun..
---John Holmes...