Here's what I'm doing, and I'm almost certain it's not the correct way but it work for me. First I took my xfile.htm and rename it xfile.php. Then within that file, above the closing tags I placed the following "" without the beginning and ending quotation marks. The file WeatherData.php contains all the coding I use to place my weather data on xfile.php. Code WeatherData.php just like you would any html file but place your php coding within tags for example;
In another php file I make the Weather Underground API calls and parse the weather data and place that weather data in a text file like CurrentTemp.txt. I would recommend searching the wunderground.com site for their Code Samples. Also remember that Google and Bing are your friends, since I'm not a php or html coder by trade any question I have I do an internet search.