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

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
 

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
 
Ad

Recently uploaded (20)

PPTX
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PDF
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
PDF
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
 
PPTX
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PDF
Executive Business Intelligence Dashboards
vandeslie24
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PDF
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
PPTX
An Introduction to ZAP by Checkmarx - Official Version
Simon Bennetts
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
PDF
Efficient, Automated Claims Processing Software for Insurers
Insurance Tech Services
 
PPTX
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PPTX
MailsDaddy Outlook OST to PST converter.pptx
abhishekdutt366
 
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
 
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Executive Business Intelligence Dashboards
vandeslie24
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
An Introduction to ZAP by Checkmarx - Official Version
Simon Bennetts
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
Efficient, Automated Claims Processing Software for Insurers
Insurance Tech Services
 
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
Tally software_Introduction_Presentation
AditiBansal54083
 
MailsDaddy Outlook OST to PST converter.pptx
abhishekdutt366
 

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]