
As said in the previous session, PHP is often used to generate HTML. PHP uses the echo command, with whatever HTML code you want to send to the browser as an argument enclosed in between double quotes. That is where things can become a bit convoluted. If there are double quotes within the HTML itself, they each need to be preceded by the '\' symbol, often referred to as being 'escaped'. You can obviously not use the < and > symbols either inside your HTML because they are used as HTML start and end tags. They are replaced by '& l t ;' and '& g t ;' , but without the spaces in between, which I used to fool PHP to be able to show the code without generating < and > symbols.
Time for another acronym: DRY. This stands for 'Don't repeat yourself'. If you were to look at the code of the previous section, you would see the same lines of HTML code repeated in every page. What a waste! So this is where the 'more' PHP comes to our help. By letting PHP generate that HTML code from PHP functions sitting in a separate php file, we can avoid that duplication, by starting with a simple 'require phpfilename.php' in each of our pages and call the functions, by only one line per function call, for all the HTML, common between our pages.