1. What is PHP?
Who invented? : Rasmus Lerdorf in 1994
History in 1994,Mr. Lerdrof developed PHP for personal use and then
in 1995,he was released first version of PHP with name PERSONAL
HOMEPAGE,and it was being used on approx 50000 site in 1997.
•PHP stands for PHP: Hypertext Preprocessor.
•PHP is a server-side scripting language
•Open Source Technology
•Robust
•Freeware
2. How it works
PHP is a general-purpose scripting language that is used in
creating Web pages, and can be embedded in HTML code. (PHP
stands for "Hypertext Pre processor" even though the acronym
doesn't match up exactly.)
PHP is an open-source program, which means it's available for
free on the Web
There are three main areas where PHP scripts are used.
− Server-side scripting.
− Command line scripting.
− Writing desktop applications
3. PHP Syntax
Method 1: Short Open Tag
<? … ?> // Not Recommended
Method 2:
<?php
….
?>
Each PHP sentence is terminated with semi-colon (;)
EXAMPLE:
<?php echo 'Hello World'; ?>
4. Comments
Single line Comment
//This is a comment
Multi line comment
/*
This is
a comment
block
*/
EXAMPLE:
<?php
//This is comment
echo '<p>Hello World</p>';
?>
6. Literals
All strings must be enclosed in single quote or double quote
Example:
<?php echo '<p>Hello World</p>'; ?>
<?php echo "<p>Hello World</p>"; ?>
NumbersNumbers are not enclosed in quotes
Example:
<?php echo 123; ?>
Booleans can be directly written as true or false
7. Language Construct
PHP have two language constructs which is used to display data
1. echo()
2. Print()
Language construct can be used with or without brackets
Example:
<?php
echo '<p>Hello World</p>';
print '<p>Hello World</p>';
echo ('<p>Hello World</p>');
print ('<p>Hello World</p>');
?>
8. Thank You
Thank You for reading…
If you have any query feel free to contact us on at
info@creativedev.in
For more information about PHP, Go to our site
www.creativedev.in