One further note on your last comment, PHP is run SERVER-SIDE. But, it is handled before the browser sees it. So, actually you CAN run your PHP on your HTML. But, it is when it runs and how to understand.
The PHP code is totally completed before the page is sent CLIENT-SIDE to the browser. So, any items pulled from the database or calculated by formulas are all handled and then added into the html.
Next, the code is send to the browser and rendered by the various parts of HTML and CSS, etc.
Also, CLIENT-SIDE, Javascript kicks in to be used "LIVE" on the browser.
I find that a lot of PHP programmers forget these facts. Especially on this site. So, I repeat them a lot whenever someone says "I can't" or "thought I could do..." . Usually you can do anything! Just takes a little thought and preliminary layout...