PHP stands for Personal Home Page. PHP also was known as Hypertext processor language. HTML stands for Hypertext Markup Language. Today, We are going to learn how we can embedding PHP in HTML. Actually, We are going to embedding HTML in PHP file. HTML is client side language and PHP is server-side language. PHP manage backend login and passing data to HTML. HTML handle that data and display to a user. Today, We are going to embedding “Hello World!” example with HTML.
Embedding PHP in HTML
We are going to embedding HTML in PHP. So, First of all, We should create a PHP file for our example. Let’s create the file at “C:\xampp\htdocs\first\thecodingstuff.php” then write the code like.
<title>Embadding HTML in PHP - TheCodingStuff</title>
<h1><?php echo "Hello, world!"; ?></h1>
So, it’s too easy We can easily embedding HTML in PHP file like above example. Now, let’s run our example by following “http://localhost/first/thecodingstuff.php” URL. If you face any issue in this example write the comment below.