There is one thing, very important to understand.
There are 2 sides if web-application, server side and client side.
It is two completely different environments.
The only connection between these 2 worlds is text. Just plain text.
There is no way.
So, the only thing you need is some experience with PHP.
And as soon you'll be able to produce this HTML code
from this PHP code
echo "<b>Hello $name</b>";
Because it is completely same way, to make something like
And only then go for PHP to generate this text dynamically