PHP can be used in many ways. It can be used to write standalone programs that run in our terminal:
echo "Hello, World!";
When run, the code above will output the following to the terminal:
But PHP was designed as a back-end web development language—specifically it was designed to work well with HTML. PHP allowed a convenient way for developers to create HTML templates and programatically fill them out in order to send customized HTML to visitors of their sites.
PHP has evolved into a powerful programming language being used for more than templating HTML, but using PHP combined with HTML remains an important part of many web developers’ skill sets.
In this lesson, we’ll delve into the difference between the front-end and the back-end and learn how to use PHP to generate HTML. If you’d like a refresher on HTML check out these lessons. Otherwise let’s dive in!
In the code editor, index.html contains the HTML code for the site in the browser.
This same static file is being delivered every time a request is made.
Move on to the next exercise to learn what is making this request and what is fulfilling it.