How to write a starting PHP tag and ending php tag

Spread the love

Like html starting and ending tags we should write php opening and closing tags for each php script which we embed in a html page.

Html opening and closing tags will be written as

<html> </html>

php opening tag can be written in different types of forms, they are

<?php ?> , <? ?> , <script language=”php”> </script> or <% %>

Example of a html page


<h1> This is a sample html page </h1>


Example of php page


Echo ‘This is sample php page’;


You can use any text editor to write the code of html of php. We have to save the file as .htm or .html if it is a pure html page and .php if it is a php embedded html page.

To run the html page we need just a browser software which doesn’t need any special software in a windows xp computer but to run the .php file we should have php engine installed and configured on a local computer.

Ask me any further doubts on this lesson.



(Visited 105 times, 1 visits today)

Leave a Reply

Your email address will not be published. Required fields are marked *