SlideShare a Scribd company logo
PHP The easiest language to learn. By Binny V A http://www.bin-co.com/php/
PHP P HP:  H ypertext  P reprocessor PHP: Hypertext Preprocessor PHP: Hypertext Preprocessor PHP: Hypertext Preprocessor PHP: ... Like GNU.
Its Easy – but Hard To use PHP, you must know... HTML SQL CSS JavaScript Web Server(Apache) Configuration Database Server(MySQL) Configuration
LAMP Linux/Apache/MySQL/PHP
Hello World! <?php print “Hello World”; ?> php file.php firefox http://localhost/file.php
Variables $ Prefix for variables $name =  'ILUG' ; // String $year =  2008 ; // Number $is_php_good =  true ; // Boolean // is a comment – as is /* to */ - PHP follows the C Syntax
Arrays/Hashes $arr = array(“Indian”, “Linux”, “User”, “Group”); $arr[1] = 'Libre'; print $arr[1]; $details = array( “abbr” => “ILUG”, “full” => “Indian Libre User Group” ); print $details['full'];
Operators +  5+2  Plus -  5-2  Minus * / ==  1 == true ===  1 !== true != %  Mod =  $a = 5 .  “hel” . “lo” etc.
Control Flow: if If if($name == 'Binny') { print “Hi, Binny”; } elseif($name == 'Sameer') { print “Hello Sameer”; } else { print “Hello everybody”; }
For/Foreach For $languages = array('PHP', 'Ruby', 'JavaScript', 'Python', 'Perl', 'Tcl'); for($i =0; $i < count($languages); $i++) { print $i+1 . “) “ . $languages[$i]; } Foreach foreach($languages as $lang) { print $lang; }
While Loop $i = 1; While($i < 10) { print $i; $i++; }
Functions function hello($name) { print “Hello, $name.”; } hello(“World”);
OOPs and PHP PHP 5 has all the most necessary OOPs features... Constructors/Destructors Visibility (public, private, protected) Static Methods/Variables Abstraction Inheritance And more...
Class class Movie { public $name; function __construct($movie_name) { $this->name = $movie_name; } function show() { print $this->name; } } $film = new Movie(“City of God”); $film->show();
Getting Help PHP Manual(CHM) Install KCHM to view it.
Functions String Functions strtolower() / strtoupper() str_replace() strpos() Array Functions array() count() array_push() array_splice() ...
Database MySQL must be installed and running. Need Information about... server(usually 'localhost') username password database
Connection mysql_connect('localhost', 'root', 'password'); mysql_select_db('database_name'); Use a database abstraction layer. $db = new Sql(“localhost”, 'root', 'password', 'database_name');
Executing Queries  $sql_handle = mysql_query(“SELECT id,name FROM users WHERE status='1'”)  or die(mysql_error()); $result = mysql_fetch_assoc($sql_handle); print $result['name'];
Fetching Result while($result = mysql_fetch_assoc($sql_handle)) { print $result['name']; } Use Database Abstraction layer!
PHP and the Web Embedding PHP... <strong><?php print hello($name) ?></strong>
Form Submission <form action=”action.php” method=”post”> Age: <input type=”text” name=”age” /> <input type=”submit” name=”action” value=”Save” /> </form>
action.php if($_POST['action'] == 'Save') { print $_POST['age']; }
Frameworks Zend CodeIgnite CakePHP Symphony And more..
Free Software CMS Tools WordPress Drupal Joomla/Mambo Forum phpBB BbPress Shopping Cart Wiki
Credits Getting Help:  http://www.flickr.com/photos/doctorow/2496308570/ MySql:  http://www.flickr.com/photos/johnniewalker/359440369/ Framework Image :  http://www.sxc.hu/photo/916787 Free Software:  http://www.flickr.com/photos/marcomolinari_it/2474783234/

More Related Content

KEY
Intermediate PHP
PDF
Introduction to PHP - Basics of PHP
KEY
Using PHP
PPTX
PHP for hacks
PDF
07 Introduction to PHP #burningkeyboards
PPTX
Phphacku iitd
PPTX
PDF
basic concept of php(Gunikhan sonowal)
Intermediate PHP
Introduction to PHP - Basics of PHP
Using PHP
PHP for hacks
07 Introduction to PHP #burningkeyboards
Phphacku iitd
basic concept of php(Gunikhan sonowal)

What's hot (20)

PPT
Php mysql
PPTX
PHP Basics and Demo HackU
PPTX
HackU PHP and Node.js
PPT
PHP - Introduction to PHP - Mazenet Solution
PPT
PHP - Introduction to PHP
PPT
Php Lecture Notes
PPT
PHP Workshop Notes
KEY
GettingStartedWithPHP
PPT
PHP POWERPOINT SLIDES
PPT
Intro to php
PPT
Intro to PHP
PPT
Class 6 - PHP Web Programming
PPTX
Hardcore PHP
PDF
Php tutorial(w3schools)
ODP
PHP5.5 is Here
PPT
Php mysql
PPT
Php with my sql
Php mysql
PHP Basics and Demo HackU
HackU PHP and Node.js
PHP - Introduction to PHP - Mazenet Solution
PHP - Introduction to PHP
Php Lecture Notes
PHP Workshop Notes
GettingStartedWithPHP
PHP POWERPOINT SLIDES
Intro to php
Intro to PHP
Class 6 - PHP Web Programming
Hardcore PHP
Php tutorial(w3schools)
PHP5.5 is Here
Php mysql
Php with my sql
Ad

Viewers also liked (7)

PDF
[Biblioteca De San Vicente + Biblioteca Central De La Ua]
PPT
Php By Virat
PDF
Development: What They Don't Teach You in College
PPTX
OOPS Characteristics (With Examples in PHP)
PPTX
Introduction to PHP OOP
PPT
Oops concepts in php
[Biblioteca De San Vicente + Biblioteca Central De La Ua]
Php By Virat
Development: What They Don't Teach You in College
OOPS Characteristics (With Examples in PHP)
Introduction to PHP OOP
Oops concepts in php
Ad

Similar to PHP: The easiest language to learn. (20)

PPTX
php basics
PPT
PDF
waptLab 04.pdfwaptLab09 tis lab is used for college lab exam
PPT
Open Source Package PHP & MySQL
PPT
Open Source Package Php Mysql 1228203701094763 9
PPT
PHP and MySQL.ppt
PPT
Phpwebdevelping
PPTX
Quick beginner to Lower-Advanced guide/tutorial in PHP
PDF
Php summary
PPT
Introduction To Php For Wit2009
PPT
Php classes in mumbai
PPT
php41.ppt
PPT
PHP InterLevel.ppt
PPT
php-I-slides.ppt
PPT
Introduction to PHP
PPTX
Php Training Workshop by Vtips
PPTX
Php basics
PPT
PHP - Introduction to PHP Fundamentals
php basics
waptLab 04.pdfwaptLab09 tis lab is used for college lab exam
Open Source Package PHP & MySQL
Open Source Package Php Mysql 1228203701094763 9
PHP and MySQL.ppt
Phpwebdevelping
Quick beginner to Lower-Advanced guide/tutorial in PHP
Php summary
Introduction To Php For Wit2009
Php classes in mumbai
php41.ppt
PHP InterLevel.ppt
php-I-slides.ppt
Introduction to PHP
Php Training Workshop by Vtips
Php basics
PHP - Introduction to PHP Fundamentals

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Network Security Unit 5.pdf for BCA BBA.
PPT
Teaching material agriculture food technology
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Approach and Philosophy of On baking technology
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Encapsulation theory and applications.pdf
sap open course for s4hana steps from ECC to s4
Understanding_Digital_Forensics_Presentation.pptx
Unlocking AI with Model Context Protocol (MCP)
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Advanced methodologies resolving dimensionality complications for autism neur...
Dropbox Q2 2025 Financial Results & Investor Presentation
Network Security Unit 5.pdf for BCA BBA.
Teaching material agriculture food technology
Review of recent advances in non-invasive hemoglobin estimation
Approach and Philosophy of On baking technology
“AI and Expert System Decision Support & Business Intelligence Systems”
Programs and apps: productivity, graphics, security and other tools
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Machine learning based COVID-19 study performance prediction
Encapsulation_ Review paper, used for researhc scholars
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

PHP: The easiest language to learn.

  • 1. PHP The easiest language to learn. By Binny V A http://www.bin-co.com/php/
  • 2. PHP P HP: H ypertext P reprocessor PHP: Hypertext Preprocessor PHP: Hypertext Preprocessor PHP: Hypertext Preprocessor PHP: ... Like GNU.
  • 3. Its Easy – but Hard To use PHP, you must know... HTML SQL CSS JavaScript Web Server(Apache) Configuration Database Server(MySQL) Configuration
  • 5. Hello World! <?php print “Hello World”; ?> php file.php firefox http://localhost/file.php
  • 6. Variables $ Prefix for variables $name = 'ILUG' ; // String $year = 2008 ; // Number $is_php_good = true ; // Boolean // is a comment – as is /* to */ - PHP follows the C Syntax
  • 7. Arrays/Hashes $arr = array(“Indian”, “Linux”, “User”, “Group”); $arr[1] = 'Libre'; print $arr[1]; $details = array( “abbr” => “ILUG”, “full” => “Indian Libre User Group” ); print $details['full'];
  • 8. Operators + 5+2 Plus - 5-2 Minus * / == 1 == true === 1 !== true != % Mod = $a = 5 . “hel” . “lo” etc.
  • 9. Control Flow: if If if($name == 'Binny') { print “Hi, Binny”; } elseif($name == 'Sameer') { print “Hello Sameer”; } else { print “Hello everybody”; }
  • 10. For/Foreach For $languages = array('PHP', 'Ruby', 'JavaScript', 'Python', 'Perl', 'Tcl'); for($i =0; $i < count($languages); $i++) { print $i+1 . “) “ . $languages[$i]; } Foreach foreach($languages as $lang) { print $lang; }
  • 11. While Loop $i = 1; While($i < 10) { print $i; $i++; }
  • 12. Functions function hello($name) { print “Hello, $name.”; } hello(“World”);
  • 13. OOPs and PHP PHP 5 has all the most necessary OOPs features... Constructors/Destructors Visibility (public, private, protected) Static Methods/Variables Abstraction Inheritance And more...
  • 14. Class class Movie { public $name; function __construct($movie_name) { $this->name = $movie_name; } function show() { print $this->name; } } $film = new Movie(“City of God”); $film->show();
  • 15. Getting Help PHP Manual(CHM) Install KCHM to view it.
  • 16. Functions String Functions strtolower() / strtoupper() str_replace() strpos() Array Functions array() count() array_push() array_splice() ...
  • 17. Database MySQL must be installed and running. Need Information about... server(usually 'localhost') username password database
  • 18. Connection mysql_connect('localhost', 'root', 'password'); mysql_select_db('database_name'); Use a database abstraction layer. $db = new Sql(“localhost”, 'root', 'password', 'database_name');
  • 19. Executing Queries $sql_handle = mysql_query(“SELECT id,name FROM users WHERE status='1'”) or die(mysql_error()); $result = mysql_fetch_assoc($sql_handle); print $result['name'];
  • 20. Fetching Result while($result = mysql_fetch_assoc($sql_handle)) { print $result['name']; } Use Database Abstraction layer!
  • 21. PHP and the Web Embedding PHP... <strong><?php print hello($name) ?></strong>
  • 22. Form Submission <form action=”action.php” method=”post”> Age: <input type=”text” name=”age” /> <input type=”submit” name=”action” value=”Save” /> </form>
  • 23. action.php if($_POST['action'] == 'Save') { print $_POST['age']; }
  • 24. Frameworks Zend CodeIgnite CakePHP Symphony And more..
  • 25. Free Software CMS Tools WordPress Drupal Joomla/Mambo Forum phpBB BbPress Shopping Cart Wiki
  • 26. Credits Getting Help: http://www.flickr.com/photos/doctorow/2496308570/ MySql: http://www.flickr.com/photos/johnniewalker/359440369/ Framework Image : http://www.sxc.hu/photo/916787 Free Software: http://www.flickr.com/photos/marcomolinari_it/2474783234/