home

Php Tags Tutorial


 

To write your php code, you need to wrap it inside PHP tags. You can think of php tags as a boundry line for php code on your page. Php tags are usually in a couple shape just like any html tags.

Php starting tag is <?php, while the ending tag is ?>

The standard way of writing php tags is

<?php
//some PHP code here
?>


Some php code can also be written inside a <script> tag:

<script language="php"> 
//some PHP code here
</script>

ASP style can also be used to write php code:

<%
//some PHP code here
%>

 A short way of writing php tags is:

<?
//some PHP code here
?>

In this php tutorial we will stick to standard way of writing php tags: <?php  ...  ?>. This way we will be sure it will work on any server running the php interpreter.

In PHP we will be using different small element again and again, some of them are:

To read about PHP comments, click here.

 


Content on this page requires a newer version of Adobe Flash Player.

Get Adobe Flash player

Copyright © 2014 by Cramerz.com.