SlideShare a Scribd company logo
PHP in one presentation
Desktop Application
Runs on a single-PC
Enterprise Application
Runs on a network
Web Application
Runs on the Internet
Request >< Response
Web Application
Client Network Server
Your app
goes here
HTML is a markup language for
describing web pages.
HTML
PHP in one presentation
is created by Rasmus Lerdorf in 1994.
stands for “Personal Home Page”.
is influenced by C, C++, Java and TCL.
competes with JSP, ASP.NET, Perl and etc.
is used to create FB, Wikipedia, WP and etc.
is used in 60-70% of the world’s websites.
PHP is free software under the PHP License.
Intro
Server:
Environment
On your own PC:
IDEs
Syntax
Functional and Object Oriented
Integers are platform-dependent equivalent to the C long type.
Data Types
Floating point numbers are also stored in a platform-specific range.
Boolean type is similar to the native Boolean types in Java and C++.
Resource type represent references to external sources.
Arrays can contain elements of any type that PHP can handle
Integer . Double . Booleans . NULL . String . Array . Object . Resource
Data Types:
Variable
Variables: <?php $number = 666; ?>
Constants: <?php define(“Name”, “Value”); ?>
Strings: <?php
$string = “Text”;
$string2 = $string . “Extra”;
?>
In Strings: <?php echo “Variable = $variable”; ?>
Casting: <?php $number = (int) $string; ?>
+
-
*
/
%
++
--
Operators
Arithmetic . Comparison . Logical . Assignment
==
!=
>
<
>=
<=
And
Or
&&
||
!
=
+=
-=
*=
/=
%=
$array[0], $array[1], $array[3], …
Array
Numeric:
$person[“name”], $person[“surname”], $person[“age”]
Associative:
$outside[key] = $inside;
Multidimensional:
Array
Decision Making
If … Else if … else … Switch
x = a ? b : c;
Loop
Function
function write($message) {
echo $message;
}
function add($num1, $num2) {
return $num1 + $num2;
}
Normal functions are not first-class.
User-defined functions can be created at any time without prototype.
Functions can be defined inside code blocks, permitting a
run-time decision as to whether or not a function should be defined.
Support for true anonymous functions is not exist in PHP.
Closure
function getAdder($x)
{
return function($y) use ($x)
{
return $x + $y;
};
}
$adder = getAdder(8);
echo $adder(2); // prints "10"
OOP
class Student {
Private $name;
Private $surname;
Private $No;
public function getName() {
return $this->name;
}
}
Define Class:
$student = new Student();
echo $student->getName();
Create Object:
OOP
class Student {
Private $name;
Private $surname;
Private $No;
public function __construct() {
// codes…
}
}
Constructor:
class Student {
Private $name;
Private $surname;
Private $No;
public function __destruct() {
// codes…
}
}
Destructor:
OOP
class Child extends Parent {
<body>
}
Inheritance
Public *
Private
Protected
Encapsulation:
OOP
interface Mail {
public function sendMail();
}
class Report implements Mail {
public function sendMail() {
// implementation…
}
}
Interface:
abstract class Sample {
abstract function method1() ;
function method2() {
// implementation…
}
}
$sample = new Sample(); // Err
Abstract Class:
OOP
class Sample {
public static $xxx;
static function abc() {
// implementation…
}
}
echo Sample::xxx;
echo Sample::abc();
Statics:
class Sample {
final public function abc() {
// final implementation
}
}
Note:
Properties cannot be declared final
Final:
Exception
try {
// Codes to run
} catch(Exception $e) {
// Process exception
} finally { // PHP 5.4
// Do anyway!
}
Syntax:
throw new Exception($message);
Throw
echo $e->getMessage();
Catch
Exception
$x = $_GET[“number”];
try {
if($x>1000)
throw new Exception(“Too big!”);
echo “The number is: “ . $x;
} catch (Exception $e) {
echo “Error: “ . $e->getMessage();
}
Example:
HTML Form
Cookie
setcookie(name, value, expire, path, domain, security);
Create:
$_COOKIE["name"];
Access:
setcookie(“Name", “Hasan Teymuri", time()+3600, "/","", 0);
Example:
Session
session_start();
Get Started:
$_SESSION [“Name"] = “Vahid Dehghani”;
Create:
echo $_SESSION[“Name”];
Access:
Hosting
Linux (CentOS)
Platform:
VPS (VDS)
Plan:
Direct Admin
Ctrl Panel:
The End
Main Source: http://tutorialspoint.com
Special thanks to Google, Wikipedia
and who has invented copy-and-paste!
Written By
Milad Rahimi [www.MiladRahimi.com]

More Related Content

PDF
Lean Php Presentation
Alan Pinstein
 
PPTX
Php presentation
Helen Pitlick
 
PPTX
PHP presentation - Com 585
jstout007
 
PPTX
Presentation php
Muhammad Saqib Malik
 
PDF
Php tutorial from_beginner_to_master
PrinceGuru MS
 
Lean Php Presentation
Alan Pinstein
 
Php presentation
Helen Pitlick
 
PHP presentation - Com 585
jstout007
 
Presentation php
Muhammad Saqib Malik
 
Php tutorial from_beginner_to_master
PrinceGuru MS
 

What's hot (20)

PPTX
Introduction to php
Taha Malampatti
 
PDF
A History of PHP
Xinchen Hui
 
PPS
PHP - History, Introduction, Summary, Extensions and Frameworks
Royston Olivera
 
PPT
Php hypertext pre-processor
Siddique Ibrahim
 
PPTX
PHP Presentation
JIGAR MAKHIJA
 
PPT
Php Presentation
Manish Bothra
 
ODP
PHP BASIC PRESENTATION
krutitrivedi
 
PPTX
Php intro
sana mateen
 
PPT
PHP - Introduction to PHP Fundamentals
Vibrant Technologies & Computers
 
PPTX
PHP Function
Reber Novanta
 
PPTX
Php technical presentation
dharmendra kumar dhakar
 
PPT
01 Php Introduction
Geshan Manandhar
 
PDF
Php introduction
krishnapriya Tadepalli
 
PPT
Php ppt
Sanmuga Nathan
 
PDF
Introduction to php web programming - get and post
baabtra.com - No. 1 supplier of quality freshers
 
PDF
Introduction to PHP
Bradley Holt
 
PPTX
Introduction to PHP
Collaboration Technologies
 
PPT
Php Ppt
vsnmurthy
 
PPT
PHP complete reference with database concepts for beginners
Mohammed Mushtaq Ahmed
 
PPT
Introduction To PHP
Shweta A
 
Introduction to php
Taha Malampatti
 
A History of PHP
Xinchen Hui
 
PHP - History, Introduction, Summary, Extensions and Frameworks
Royston Olivera
 
Php hypertext pre-processor
Siddique Ibrahim
 
PHP Presentation
JIGAR MAKHIJA
 
Php Presentation
Manish Bothra
 
PHP BASIC PRESENTATION
krutitrivedi
 
Php intro
sana mateen
 
PHP - Introduction to PHP Fundamentals
Vibrant Technologies & Computers
 
PHP Function
Reber Novanta
 
Php technical presentation
dharmendra kumar dhakar
 
01 Php Introduction
Geshan Manandhar
 
Php introduction
krishnapriya Tadepalli
 
Introduction to php web programming - get and post
baabtra.com - No. 1 supplier of quality freshers
 
Introduction to PHP
Bradley Holt
 
Introduction to PHP
Collaboration Technologies
 
Php Ppt
vsnmurthy
 
PHP complete reference with database concepts for beginners
Mohammed Mushtaq Ahmed
 
Introduction To PHP
Shweta A
 
Ad

Viewers also liked (14)

PPT
Core Php Component Presentation
John Coonen
 
PPTX
PHP
Jawhar Ali
 
PDF
Threads in PHP - Presentation
appserver.io
 
PPTX
Php oop presentation
Mutinda Boniface
 
PDF
Devise | Presentation for Alpharetta PHP / Laravel Group
Gary Williams
 
PPTX
PHP presentation
Helen Pitlick
 
ODP
Internationalisation with PHP and Intl
Daniel_Rhodes
 
ODP
Introduction of Html/css/js
Knoldus Inc.
 
PPTX
Php string function
Ravi Bhadauria
 
PDF
PHP Tour 2016 Phinx Presentation
Rob Morgan
 
PPSX
Php string
argusacademy
 
KEY
HTML CSS & Javascript
David Lindkvist
 
PPT
Html JavaScript and CSS
Radhe Krishna Rajan
 
PPTX
Principles of Teaching 1: Objective-Related Principles of Teaching
SirJim SirVelasco
 
Core Php Component Presentation
John Coonen
 
Threads in PHP - Presentation
appserver.io
 
Php oop presentation
Mutinda Boniface
 
Devise | Presentation for Alpharetta PHP / Laravel Group
Gary Williams
 
PHP presentation
Helen Pitlick
 
Internationalisation with PHP and Intl
Daniel_Rhodes
 
Introduction of Html/css/js
Knoldus Inc.
 
Php string function
Ravi Bhadauria
 
PHP Tour 2016 Phinx Presentation
Rob Morgan
 
Php string
argusacademy
 
HTML CSS & Javascript
David Lindkvist
 
Html JavaScript and CSS
Radhe Krishna Rajan
 
Principles of Teaching 1: Objective-Related Principles of Teaching
SirJim SirVelasco
 
Ad

Similar to PHP in one presentation (20)

PPTX
Constructor and encapsulation in php
SHIVANI SONI
 
PDF
PHP 8: Process & Fixing Insanity
GeorgePeterBanyard
 
PDF
Drupaljam xl 2019 presentation multilingualism makes better programmers
Alexander Varwijk
 
PPT
PHP and COM
Wez Furlong
 
PDF
Framework agnostic application Will it fit with Symfony? - Symfony live warsa...
Dariusz Drobisz
 
PDF
OOP in PHP
Tarek Mahmud Apu
 
PPTX
Node.js Patterns for Discerning Developers
cacois
 
PDF
Design attern in php
Filippo De Santis
 
PPTX
PHP: GraphQL consistency through code generation
Alexander Obukhov
 
PDF
Hexagonal architecture in PHP
Paulo Victor Gomes
 
PPTX
The basics of php for engeneering students
rahuljustin77
 
PPTX
Jquery in web development, including Jquery in HTML
backiyalakshmi14
 
PDF
Multilingualism makes better programmers
Alexander Varwijk
 
DOCX
Oops concept in php
selvabalaji k
 
PDF
Living With Legacy Code
Rowan Merewood
 
PPTX
CSharp presentation and software developement
frwebhelp
 
PPTX
Building a friendly .NET SDK to connect to Space
Maarten Balliauw
 
KEY
Fatc
Wade Arnold
 
PPT
Visual Studio .NET2010
Satish Verma
 
PDF
TI1220 Lecture 14: Domain-Specific Languages
Eelco Visser
 
Constructor and encapsulation in php
SHIVANI SONI
 
PHP 8: Process & Fixing Insanity
GeorgePeterBanyard
 
Drupaljam xl 2019 presentation multilingualism makes better programmers
Alexander Varwijk
 
PHP and COM
Wez Furlong
 
Framework agnostic application Will it fit with Symfony? - Symfony live warsa...
Dariusz Drobisz
 
OOP in PHP
Tarek Mahmud Apu
 
Node.js Patterns for Discerning Developers
cacois
 
Design attern in php
Filippo De Santis
 
PHP: GraphQL consistency through code generation
Alexander Obukhov
 
Hexagonal architecture in PHP
Paulo Victor Gomes
 
The basics of php for engeneering students
rahuljustin77
 
Jquery in web development, including Jquery in HTML
backiyalakshmi14
 
Multilingualism makes better programmers
Alexander Varwijk
 
Oops concept in php
selvabalaji k
 
Living With Legacy Code
Rowan Merewood
 
CSharp presentation and software developement
frwebhelp
 
Building a friendly .NET SDK to connect to Space
Maarten Balliauw
 
Visual Studio .NET2010
Satish Verma
 
TI1220 Lecture 14: Domain-Specific Languages
Eelco Visser
 

Recently uploaded (20)

PPTX
PFAS Reporting Requirements 2026 Are You Submission Ready Certivo.pptx
Certivo Inc
 
PPTX
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
PDF
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
PDF
The Role of Automation and AI in EHS Management for Data Centers.pdf
TECH EHS Solution
 
PDF
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 
PDF
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
Hironori Washizaki
 
DOCX
The Future of Smart Factories Why Embedded Analytics Leads the Way
Varsha Nayak
 
PPTX
Why Use Open Source Reporting Tools for Business Intelligence.pptx
Varsha Nayak
 
PPTX
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
PDF
Community & News Update Q2 Meet Up 2025
VictoriaMetrics
 
PPTX
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
PPTX
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
PDF
Become an Agentblazer Champion Challenge
Dele Amefo
 
PDF
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
QAware GmbH
 
PDF
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
PDF
Microsoft Teams Essentials; The pricing and the versions_PDF.pdf
Q-Advise
 
PDF
Bandai Playdia The Book - David Glotz
BluePanther6
 
PPTX
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
PDF
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
PDF
How to Seamlessly Integrate Salesforce Data Cloud with Marketing Cloud.pdf
NSIQINFOTECH
 
PFAS Reporting Requirements 2026 Are You Submission Ready Certivo.pptx
Certivo Inc
 
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
The Role of Automation and AI in EHS Management for Data Centers.pdf
TECH EHS Solution
 
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
Hironori Washizaki
 
The Future of Smart Factories Why Embedded Analytics Leads the Way
Varsha Nayak
 
Why Use Open Source Reporting Tools for Business Intelligence.pptx
Varsha Nayak
 
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
Community & News Update Q2 Meet Up 2025
VictoriaMetrics
 
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
Become an Agentblazer Champion Challenge
Dele Amefo
 
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
QAware GmbH
 
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
Microsoft Teams Essentials; The pricing and the versions_PDF.pdf
Q-Advise
 
Bandai Playdia The Book - David Glotz
BluePanther6
 
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
How to Seamlessly Integrate Salesforce Data Cloud with Marketing Cloud.pdf
NSIQINFOTECH
 

PHP in one presentation

  • 4. Web Application Runs on the Internet
  • 5. Request >< Response Web Application Client Network Server Your app goes here
  • 6. HTML is a markup language for describing web pages. HTML
  • 8. is created by Rasmus Lerdorf in 1994. stands for “Personal Home Page”. is influenced by C, C++, Java and TCL. competes with JSP, ASP.NET, Perl and etc. is used to create FB, Wikipedia, WP and etc. is used in 60-70% of the world’s websites. PHP is free software under the PHP License. Intro
  • 10. IDEs
  • 12. Integers are platform-dependent equivalent to the C long type. Data Types Floating point numbers are also stored in a platform-specific range. Boolean type is similar to the native Boolean types in Java and C++. Resource type represent references to external sources. Arrays can contain elements of any type that PHP can handle Integer . Double . Booleans . NULL . String . Array . Object . Resource Data Types:
  • 13. Variable Variables: <?php $number = 666; ?> Constants: <?php define(“Name”, “Value”); ?> Strings: <?php $string = “Text”; $string2 = $string . “Extra”; ?> In Strings: <?php echo “Variable = $variable”; ?> Casting: <?php $number = (int) $string; ?>
  • 14. + - * / % ++ -- Operators Arithmetic . Comparison . Logical . Assignment == != > < >= <= And Or && || ! = += -= *= /= %=
  • 15. $array[0], $array[1], $array[3], … Array Numeric: $person[“name”], $person[“surname”], $person[“age”] Associative: $outside[key] = $inside; Multidimensional:
  • 16. Array
  • 17. Decision Making If … Else if … else … Switch x = a ? b : c;
  • 18. Loop
  • 19. Function function write($message) { echo $message; } function add($num1, $num2) { return $num1 + $num2; } Normal functions are not first-class. User-defined functions can be created at any time without prototype. Functions can be defined inside code blocks, permitting a run-time decision as to whether or not a function should be defined. Support for true anonymous functions is not exist in PHP.
  • 20. Closure function getAdder($x) { return function($y) use ($x) { return $x + $y; }; } $adder = getAdder(8); echo $adder(2); // prints "10"
  • 21. OOP class Student { Private $name; Private $surname; Private $No; public function getName() { return $this->name; } } Define Class: $student = new Student(); echo $student->getName(); Create Object:
  • 22. OOP class Student { Private $name; Private $surname; Private $No; public function __construct() { // codes… } } Constructor: class Student { Private $name; Private $surname; Private $No; public function __destruct() { // codes… } } Destructor:
  • 23. OOP class Child extends Parent { <body> } Inheritance Public * Private Protected Encapsulation:
  • 24. OOP interface Mail { public function sendMail(); } class Report implements Mail { public function sendMail() { // implementation… } } Interface: abstract class Sample { abstract function method1() ; function method2() { // implementation… } } $sample = new Sample(); // Err Abstract Class:
  • 25. OOP class Sample { public static $xxx; static function abc() { // implementation… } } echo Sample::xxx; echo Sample::abc(); Statics: class Sample { final public function abc() { // final implementation } } Note: Properties cannot be declared final Final:
  • 26. Exception try { // Codes to run } catch(Exception $e) { // Process exception } finally { // PHP 5.4 // Do anyway! } Syntax: throw new Exception($message); Throw echo $e->getMessage(); Catch
  • 27. Exception $x = $_GET[“number”]; try { if($x>1000) throw new Exception(“Too big!”); echo “The number is: “ . $x; } catch (Exception $e) { echo “Error: “ . $e->getMessage(); } Example:
  • 29. Cookie setcookie(name, value, expire, path, domain, security); Create: $_COOKIE["name"]; Access: setcookie(“Name", “Hasan Teymuri", time()+3600, "/","", 0); Example:
  • 30. Session session_start(); Get Started: $_SESSION [“Name"] = “Vahid Dehghani”; Create: echo $_SESSION[“Name”]; Access:
  • 32. The End Main Source: http://tutorialspoint.com Special thanks to Google, Wikipedia and who has invented copy-and-paste! Written By Milad Rahimi [www.MiladRahimi.com]