Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Php php Basic Syntax

 
 

Share on Google+Share on Google+

php Basic Syntax

Advertisement
In the given tutorial we will study how to write the basic syntax of php:

php Basic Syntax

     

In the given tutorial we will study how to write the basic syntax of php:

<?php

?>

The above mentioned tag will be included in each php file and each php coding has to be written within this tag.

<?php

echo "Hello World";

?>

The above coding will print Hello World in the output screen or web page.

We can combine both php and html file in a single file, following example illustrates that:

Code: 

<html>

<body>This is html portion<br/></body>

</html>

<?php

echo"This is in php portion";

?>

Output:

This is html portion
This is in php portion

php syntax is more or less similar to any other popular language like: C, ASP, Java etc. In this language semicolon is as important as other language. There are many more similarities are also present like in php white spaces don't make any special difference.

Example:

<?php

echo"

This

is

in

php

portion";

?>

Output:

This is in php portion

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: December 17, 2009

Related Tutorials

Discuss: php Basic Syntax   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:1
dhanush
August 18, 2011
hi

easy to learn and quickly to understand
DMCA.com