Lunarpages.com Web Hosting Lunarpages.com Web Hosting

How to write a starting PHP tag and ending php tag

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

<html>

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

</html>

Example of php page

<?php

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.

Thanks

Raj

Tags: ,

Leave a Comment