PHP is a Hypertext Preprocessor. This essentially means that PHP dynamically writes web pages for you. So it can query a database and print a report from it, or change CSS and such based on specific criteria.
The foreach() function can turn Named Keys into variables just like it does array values.
By turning a file into an array you can work with the data within it as you would a standard array.