170 likes | 186 Views
Learn the history, purpose, and structure of PHP programming language. Understand the PHP language reference, its working, and key developers.
E N D
PHP Pattadon Sintusak ID. 49541154
Content • History ofPHP • What’s PHP? • Purpose of PHP • Structure ofPHP • Language Reference • Different betweenPHP andASP PHP Programming
HISTORY ofPHP • PHP stands for“Professional Home Page” • It’s first build in 1994 • Developeris Mr.Rasmus Lerdorf • Nowadays, PHP is the fourth version , • The first version was known asPersonal Homepage Tools in 1994 to 1995 • The second was PHP/FI in middle of 1995 • Version 3 was known asPHP3 firstly used in 1997 PHP Programming
Developers of PHP • Zeev Suraski, Israel • Andi Gutmans, Israel • Shane Caraveo, Florida USA • Stig Bakken, Norway • Andrey Zmievski, Nebraska USA • Sascha Schumann, Dortmund, Germany • Thies C. Arntzen, Hamburg, Germany • Jim Winstead, Los Angeles, USA • Rasmus Lerdorf, North Carolina, USA PHP Programming
What’s PHP? • It’s aScript language for showing webpage, arrange in Server Side Script group likeASP • Insert inHTML for working • Can compile in UNIX, Windows NT/2000/XP, Windows 9x • High efficiency,especially when connect with Database such as MySQL, msSQL, Sybase andPostgreSQL etc. PHP Programming
PHP can do !! • CGI • Database-enable web page • Database Adabas D InterBase Solid DBase mSQL Sybase Empress MySQL Velocis FilePro Oracle Unix dbm Informix PostgreSQL PHP Programming
Purpose of PHP • Open source • No cost implementation – PHP is free! • Server side • Crossable Platform • HTML embedded • Simple language • Efficiency • XML parsing • Server side • Database module • File I/O • Text processing • Image processing PHP Programming
Working ofPHP • Working onServer • Working with HTML • Can insert PHP commands as you want inHTML document • Show output byWeb Browsers PHP Programming
Language structure ofPHP • XML style <?php language commandPHP ?> Example. <?php echo “Hello World ! <br>”; echo “I am PHP”; ?> PHP Programming
Language structure ofPHP(cont.) • SGML style <?Language commandPHP ?> Example. <? echo “Hello World ! <br>”; echo “I am PHP”; ?> PHP Programming
Language structure ofPHP(cont.) • Java Language style <script language=“php”> language commandPHP </script> Example. <script language=“php”> echo “Hello World”; </script> PHP Programming
Language structure ofPHP(cont.) • ASP Style <%language commandPHP %> Example. <% echo “Hello World ! <br>”; echo “I am PHP”; %> PHP Programming
Language structure ofPHP(cont.) • XML style is the most popular style. • Output is Hello World ! I am PHP • Notice - Language structure is similar to C andPerl - use( ; ) to end each command. • File must savein.php (orphp3) PHP Programming
Language Reference • Comments - similar to comment inC, C++ and Unix • Example. <?php echo “Hello !”; // comment 1 line /* at least 2 lines */ echo “World”; # comment in shell-style ?> PHP Programming
“Echo” command • is a command for showing output atbrowser program • format echo statement1 or variable1, statement2or variable2, statement3or variable3, … • statementis bestrided bydouble quote (“ “) orsingle quote (‘ ‘) • Variable ofPHP always begin with$ like Perl PHP Programming
Example 1 intro.php <HTML> <HEAD> <TITLE>Example –1</TITLE> </HEAD> <BODY> <?php phpinfo() ; ?> <BODY> </HTML> PHP Programming
Example 2(date.php) <HTML> <HEAD> <TITLE> Example –2</TITLE> </HEAD> <BODY> Today’s Date: <? print(Date("l F d, Y")); ?> </BODY> </HTML> Today's Date: Thursday March 10, 2003 PHP Programming