SlideShare a Scribd company logo
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
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

Introduction to php
Introduction to phpIntroduction to php
Introduction to php
Taha Malampatti
 
A History of PHP
A History of PHPA History of PHP
A History of PHP
Xinchen Hui
 
PHP - History, Introduction, Summary, Extensions and Frameworks
PHP - History, Introduction, Summary, Extensions and FrameworksPHP - History, Introduction, Summary, Extensions and Frameworks
PHP - History, Introduction, Summary, Extensions and FrameworksRoyston Olivera
 
Php hypertext pre-processor
Php   hypertext pre-processorPhp   hypertext pre-processor
Php hypertext pre-processorSiddique Ibrahim
 
PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
JIGAR MAKHIJA
 
PHP BASIC PRESENTATION
PHP BASIC PRESENTATIONPHP BASIC PRESENTATION
PHP BASIC PRESENTATION
krutitrivedi
 
Php intro
Php introPhp intro
Php intro
sana mateen
 
PHP - Introduction to PHP Fundamentals
PHP -  Introduction to PHP FundamentalsPHP -  Introduction to PHP Fundamentals
PHP - Introduction to PHP Fundamentals
Vibrant Technologies & Computers
 
PHP Function
PHP Function PHP Function
PHP Function
Reber Novanta
 
Php technical presentation
Php technical presentationPhp technical presentation
Php technical presentation
dharmendra kumar dhakar
 
01 Php Introduction
01 Php Introduction01 Php Introduction
01 Php Introduction
Geshan Manandhar
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
Bradley Holt
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
Collaboration Technologies
 
PHP complete reference with database concepts for beginners
PHP complete reference with database concepts for beginnersPHP complete reference with database concepts for beginners
PHP complete reference with database concepts for beginners
Mohammed Mushtaq Ahmed
 
Introduction To PHP
Introduction To PHPIntroduction To PHP
Introduction To PHP
Shweta A
 

What's hot (20)

Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
A History of PHP
A History of PHPA History of PHP
A History of PHP
 
PHP - History, Introduction, Summary, Extensions and Frameworks
PHP - History, Introduction, Summary, Extensions and FrameworksPHP - History, Introduction, Summary, Extensions and Frameworks
PHP - History, Introduction, Summary, Extensions and Frameworks
 
Php hypertext pre-processor
Php   hypertext pre-processorPhp   hypertext pre-processor
Php hypertext pre-processor
 
PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
 
Php Presentation
Php PresentationPhp Presentation
Php Presentation
 
PHP BASIC PRESENTATION
PHP BASIC PRESENTATIONPHP BASIC PRESENTATION
PHP BASIC PRESENTATION
 
Php intro
Php introPhp intro
Php intro
 
PHP - Introduction to PHP Fundamentals
PHP -  Introduction to PHP FundamentalsPHP -  Introduction to PHP Fundamentals
PHP - Introduction to PHP Fundamentals
 
PHP Function
PHP Function PHP Function
PHP Function
 
Php technical presentation
Php technical presentationPhp technical presentation
Php technical presentation
 
01 Php Introduction
01 Php Introduction01 Php Introduction
01 Php Introduction
 
Php introduction
Php introductionPhp introduction
Php introduction
 
Php ppt
Php pptPhp ppt
Php ppt
 
Introduction to php web programming - get and post
Introduction to php  web programming - get and postIntroduction to php  web programming - get and post
Introduction to php web programming - get and post
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Php Ppt
Php PptPhp Ppt
Php Ppt
 
PHP complete reference with database concepts for beginners
PHP complete reference with database concepts for beginnersPHP complete reference with database concepts for beginners
PHP complete reference with database concepts for beginners
 
Introduction To PHP
Introduction To PHPIntroduction To PHP
Introduction To PHP
 

Viewers also liked

Core Php Component Presentation
Core Php Component PresentationCore Php Component Presentation
Core Php Component Presentation
John Coonen
 
PHP
PHPPHP
Threads in PHP - Presentation
Threads in PHP - Presentation Threads in PHP - Presentation
Threads in PHP - Presentation
appserver.io
 
Php oop presentation
Php   oop presentationPhp   oop presentation
Php oop presentation
Mutinda Boniface
 
Devise | Presentation for Alpharetta PHP / Laravel Group
Devise | Presentation for Alpharetta PHP / Laravel GroupDevise | Presentation for Alpharetta PHP / Laravel Group
Devise | Presentation for Alpharetta PHP / Laravel Group
Gary Williams
 
PHP presentation
PHP presentationPHP presentation
PHP presentation
Helen Pitlick
 
Internationalisation with PHP and Intl
Internationalisation with PHP and IntlInternationalisation with PHP and Intl
Internationalisation with PHP and Intl
Daniel_Rhodes
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
Knoldus Inc.
 
Php string function
Php string function Php string function
Php string function
Ravi Bhadauria
 
PHP Tour 2016 Phinx Presentation
PHP Tour 2016 Phinx PresentationPHP Tour 2016 Phinx Presentation
PHP Tour 2016 Phinx Presentation
Rob Morgan
 
Php string
Php stringPhp string
Php string
argusacademy
 
HTML CSS & Javascript
HTML CSS & JavascriptHTML CSS & Javascript
HTML CSS & Javascript
David Lindkvist
 
Principles of Teaching 1: Objective-Related Principles of Teaching
Principles of Teaching 1: Objective-Related Principles of TeachingPrinciples of Teaching 1: Objective-Related Principles of Teaching
Principles of Teaching 1: Objective-Related Principles of Teaching
SirJim SirVelasco
 

Viewers also liked (14)

Core Php Component Presentation
Core Php Component PresentationCore Php Component Presentation
Core Php Component Presentation
 
PHP
PHPPHP
PHP
 
Threads in PHP - Presentation
Threads in PHP - Presentation Threads in PHP - Presentation
Threads in PHP - Presentation
 
Php oop presentation
Php   oop presentationPhp   oop presentation
Php oop presentation
 
Devise | Presentation for Alpharetta PHP / Laravel Group
Devise | Presentation for Alpharetta PHP / Laravel GroupDevise | Presentation for Alpharetta PHP / Laravel Group
Devise | Presentation for Alpharetta PHP / Laravel Group
 
PHP presentation
PHP presentationPHP presentation
PHP presentation
 
Internationalisation with PHP and Intl
Internationalisation with PHP and IntlInternationalisation with PHP and Intl
Internationalisation with PHP and Intl
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
 
Php string function
Php string function Php string function
Php string function
 
PHP Tour 2016 Phinx Presentation
PHP Tour 2016 Phinx PresentationPHP Tour 2016 Phinx Presentation
PHP Tour 2016 Phinx Presentation
 
Php string
Php stringPhp string
Php string
 
HTML CSS & Javascript
HTML CSS & JavascriptHTML CSS & Javascript
HTML CSS & Javascript
 
Html JavaScript and CSS
Html JavaScript and CSSHtml JavaScript and CSS
Html JavaScript and CSS
 
Principles of Teaching 1: Objective-Related Principles of Teaching
Principles of Teaching 1: Objective-Related Principles of TeachingPrinciples of Teaching 1: Objective-Related Principles of Teaching
Principles of Teaching 1: Objective-Related Principles of Teaching
 

Similar to PHP in one presentation

Constructor and encapsulation in php
Constructor and encapsulation in phpConstructor and encapsulation in php
Constructor and encapsulation in php
SHIVANI SONI
 
PHP 8: Process & Fixing Insanity
PHP 8: Process & Fixing InsanityPHP 8: Process & Fixing Insanity
PHP 8: Process & Fixing Insanity
GeorgePeterBanyard
 
Drupaljam xl 2019 presentation multilingualism makes better programmers
Drupaljam xl 2019 presentation   multilingualism makes better programmersDrupaljam xl 2019 presentation   multilingualism makes better programmers
Drupaljam xl 2019 presentation multilingualism makes better programmers
Alexander Varwijk
 
PHP and COM
PHP and COMPHP and COM
PHP and COM
Wez Furlong
 
Framework agnostic application Will it fit with Symfony? - Symfony live warsa...
Framework agnostic application Will it fit with Symfony? - Symfony live warsa...Framework agnostic application Will it fit with Symfony? - Symfony live warsa...
Framework agnostic application Will it fit with Symfony? - Symfony live warsa...
Dariusz Drobisz
 
Node.js Patterns for Discerning Developers
Node.js Patterns for Discerning DevelopersNode.js Patterns for Discerning Developers
Node.js Patterns for Discerning Developers
cacois
 
PHP: GraphQL consistency through code generation
PHP: GraphQL consistency through code generationPHP: GraphQL consistency through code generation
PHP: GraphQL consistency through code generation
Alexander Obukhov
 
Hexagonal architecture in PHP
Hexagonal architecture in PHPHexagonal architecture in PHP
Hexagonal architecture in PHP
Paulo Victor Gomes
 
Multilingualism makes better programmers
Multilingualism makes better programmersMultilingualism makes better programmers
Multilingualism makes better programmers
Alexander Varwijk
 
Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy Code
Rowan Merewood
 
CSharp presentation and software developement
CSharp presentation and software developementCSharp presentation and software developement
CSharp presentation and software developement
frwebhelp
 
Building a friendly .NET SDK to connect to Space
Building a friendly .NET SDK to connect to SpaceBuilding a friendly .NET SDK to connect to Space
Building a friendly .NET SDK to connect to Space
Maarten Balliauw
 
Fatc
FatcFatc
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010Satish Verma
 
TI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific LanguagesTI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific LanguagesEelco Visser
 
FYBSC IT Web Programming Unit IV PHP and MySQL
FYBSC IT Web Programming Unit IV  PHP and MySQLFYBSC IT Web Programming Unit IV  PHP and MySQL
FYBSC IT Web Programming Unit IV PHP and MySQL
Arti Parab Academics
 
WT_PHP_PART1.pdf
WT_PHP_PART1.pdfWT_PHP_PART1.pdf
WT_PHP_PART1.pdf
HambardeAtharva
 

Similar to PHP in one presentation (20)

Constructor and encapsulation in php
Constructor and encapsulation in phpConstructor and encapsulation in php
Constructor and encapsulation in php
 
PHP 8: Process & Fixing Insanity
PHP 8: Process & Fixing InsanityPHP 8: Process & Fixing Insanity
PHP 8: Process & Fixing Insanity
 
Drupaljam xl 2019 presentation multilingualism makes better programmers
Drupaljam xl 2019 presentation   multilingualism makes better programmersDrupaljam xl 2019 presentation   multilingualism makes better programmers
Drupaljam xl 2019 presentation multilingualism makes better programmers
 
PHP and COM
PHP and COMPHP and COM
PHP and COM
 
Framework agnostic application Will it fit with Symfony? - Symfony live warsa...
Framework agnostic application Will it fit with Symfony? - Symfony live warsa...Framework agnostic application Will it fit with Symfony? - Symfony live warsa...
Framework agnostic application Will it fit with Symfony? - Symfony live warsa...
 
OOP in PHP
OOP in PHPOOP in PHP
OOP in PHP
 
Node.js Patterns for Discerning Developers
Node.js Patterns for Discerning DevelopersNode.js Patterns for Discerning Developers
Node.js Patterns for Discerning Developers
 
Design attern in php
Design attern in phpDesign attern in php
Design attern in php
 
PHP: GraphQL consistency through code generation
PHP: GraphQL consistency through code generationPHP: GraphQL consistency through code generation
PHP: GraphQL consistency through code generation
 
Hexagonal architecture in PHP
Hexagonal architecture in PHPHexagonal architecture in PHP
Hexagonal architecture in PHP
 
Multilingualism makes better programmers
Multilingualism makes better programmersMultilingualism makes better programmers
Multilingualism makes better programmers
 
Oops concept in php
Oops concept in phpOops concept in php
Oops concept in php
 
Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy Code
 
CSharp presentation and software developement
CSharp presentation and software developementCSharp presentation and software developement
CSharp presentation and software developement
 
Building a friendly .NET SDK to connect to Space
Building a friendly .NET SDK to connect to SpaceBuilding a friendly .NET SDK to connect to Space
Building a friendly .NET SDK to connect to Space
 
Fatc
FatcFatc
Fatc
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010
 
TI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific LanguagesTI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific Languages
 
FYBSC IT Web Programming Unit IV PHP and MySQL
FYBSC IT Web Programming Unit IV  PHP and MySQLFYBSC IT Web Programming Unit IV  PHP and MySQL
FYBSC IT Web Programming Unit IV PHP and MySQL
 
WT_PHP_PART1.pdf
WT_PHP_PART1.pdfWT_PHP_PART1.pdf
WT_PHP_PART1.pdf
 

Recently uploaded

Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 

Recently uploaded (20)

Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 

PHP in one presentation

  • 1.
  • 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
  • 7.
  • 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]