When someone starts learning web development they usually start with HTML and possibly CSS. They usually get stuck here and most do not even venture into server side scripting like php.
It is important to know the different between HTML and php in that when someone writes HTML and they upload it in the form of a web page. When someone views (downloads) that page, they download all the code and it is decoded by the web browser. In php, you never see the code the author wrote, instead – only the output. In a php file it is first processed by the server to display the output to the client and in turn produces HTML. Therefore, the user views plain HTML where the server has already sorted the Php.
The main aim of Php is to be able to provide dynamic webpages. So, either based on a time, form result or otherwise. For example, a search box. You could have a database full of blog posts. If someone searched your site then you would expect the site to search for any matching results and ONLY display those. HTML could do that with javascript you say, but downloading a HTML page with every blog post in it (just not displayed) can take a while. And database queries cannot be run on the computer. Mainly because they don’t exist there.
Imagine trying to update a large website, moving every bit of code from page 1 to 2, from 2 to 3, from 3 to 4 and so on just to only show 10 per page. Php does this quite easily. It finds put which page you are on (probably by parameter) and then searches the database for the blog posts 20-30. Just imagine trying to download a HTML file with 300 posts in it.
