How a PHP program look like



PHP programs are saved in a file with extension “.php”  ( we can use it in .html files also , that I will explain other posts ).

PHP scripts will be in between <?php and   ?> tags.

<?php  is the starting tag ( where our php program in the page starts ) and ?> ending tag ( where our php program ends ).

PHP programs are embedding in between html codes and we can use the html codes inside our php programs also.

Basically a PHP program page will look like

<html>
<body>
<h1>How a PHP program look like<h1>
<?php
/* Here is a block of PHP codes in page */
?>
<h2> HTML portions </h2>
<?php
/* Here is another block of PHP code /*
?>
</body>
<html>

Here we can see that we can use any number of blocks of PHP codes with a mixture of HTML codes  in a page with starting and ending tags of PHP.