Starting with php

Php is server side scripting language, It handles users requests and perform all its functions on server. It is very easy and fast language. Php is an open source which means you can use/modifiy it as per your needs freely. Php script is written within some specific tags which are given below in table.
Tag Style Start Tag End Tag
Standard Tag <?php ?>
Shot Tag <? ?>
Script Tag <script language="php"> </script>
ASP Tag <% %>


It may be possible short tag and ASP tag are not enabled. In order to activate short tag and asp, you have to do setting in php configuration file i.e. php.ini.

To enable these tags you may use any one of the following setting in php.ini file.

short_open_tag=on;
OR
short_open_tag=yes;
OR
short_open_tag=true;
In same way for ASP tags.
asp_tags=on;
OR
asp_tags=yes;
OR
asp_tags=true;

Now let us write our first program in php with different tags. For getting output on browser we are going to use bulit-in function print. We shall write in double quotes ("") because in php string is written in double quotes and every line ends with ; .

1. Standard Tag

<html>
<head>
<title>Hello World</title>

</head>
<body>
<?php
print "Hello World";
?>
</body>
</html>

2. Script Tag

<html>
<head>
<title>Hello World</title>

</head>
<body>
<script language="php">
print "Hello World";
</script>
</body>
</html>

3. Short Tag

<html>
<head>
<title>Hello World</title>

</head>
<body>
<?
print "Hello World";
<?
</body>
</html>

1. ASP Tags

<html>
<head>
<title>Hello World</title>

</head>
<body>
<%
print "Hello World";
%>
</body>
</html>

In all cases we get same Result i.e. Hello World.