SlideShare a Scribd company logo
PHP
MOHAMED LOEY
Agenda
 Part I: Introduction
 Part II: PHP Syntax
 Part III: PHP Form Handling
Agenda
 Part I: Introduction
 What is PHP?
 Why we use PHP?
 PHP Can
 Set Up PHP on Your Own PC
What is PHP?
 PHP is a server scripting language, and
is a powerful tool for making dynamic
and interactive Web pages quickly.
 PHP is a widely-used, open source
scripting language
 PHP scripts are executed on the server
 PHP costs nothing, it is free to
download and use
Why we use PHP?
 PHP runs on various platforms (Windows, Linux,
Unix, Mac OS X, etc.)
 PHP is compatible with almost all servers used
today (Apache, IIS, etc.)
 PHP supports a wide range of databases
 PHP is easy to learn and runs efficiently on the
server side
 It is powerful enough to be at the core of the
biggest blogging system on the web
(WordPress)!
 It is deep enough to run the largest social
network (Facebook)!
PHP Can
 Generate dynamic page content
 Create, open, read, write, delete, and
close files on the server
 Send and receive cookies
 Add, delete, modify data in your
database
 Encrypt data
 Output images, PDF files, and even
Flash movies
Set Up PHP on Your Own PC
 Install a web server (Apache)
 Install PHP
 Install a database, such as MySQL
 Example: XAMPP (Apache + MySQL +
PHP + Perl)
 XAMPP is the most popular PHP
development environment
Agenda
 Part II: PHP Syntax
 PHP Syntax
 Comments in PHP
 PHP Case Sensitivity
 PHP Variables
 PHP echo and print Statements
 PHP Operators
 PHP Conditional Statements
 PHP Loops
 PHP Functions
 PHP Arrays
PHP Syntax
 PHP script can be placed anywhere in
the document.
 A PHP script starts with <?php and
ends with ?>
 The default file extension for PHP files
is ".php".
Simple PHP Code
Comments in PHP
 A comment in PHP code is a line that is
not read/executed as part of the
program.
 PHP supports three ways of
commenting:
PHP Case Sensitivity
 In PHP, all user-defined functions,
classes, and keywords (e.g. if, else,
while, echo, etc.) are NOT case-
sensitive.
 Example:
PHP Case Sensitivity
 However; in PHP, all variables are case-
sensitive.
 $color, $COLOR, and $coLOR are
treated as three different variables
 Example:
PHP Variables
 Variables are "containers" for storing
information.
 A variable starts with the $ sign, followed by
the name of the variable
 A variable name must start with a letter or
the underscore character
 A variable name cannot start with a number
 A variable name can only contain alpha-
numeric characters and underscores (A-z, 0-9,
and _ )
 Variable names are case sensitive ($y and $Y
are two different variables)
PHP Variables
 PHP has no command for declaring a variable.
 Example:
PHP echo and print Statements
 In PHP there are two basic ways to get output:
echo and print.
 There are some differences between echo and
print:
 echo - can output one or more strings
 print - can only output one string, and returns always
1
 Example:
PHP Operators
 PHP Arithmetic Operators
PHP Operators
 PHP Arithmetic Operators Example:
PHP Operators
 PHP Assignment Operators
PHP Operators
 PHP Assignment Operators Example:
PHP Operators
 PHP String Operators
PHP Operators
 PHP String Operators Example:
PHP Operators
 PHP Increment / Decrement Operators
PHP Operators
 PHP Increment / Decrement Operators
Example:
PHP Operators
 PHP Comparison Operators
PHP Operators
 PHP Comparison Operators Example:
PHP Operators
 PHP Logical Operators
PHP Operators
 PHP Array Operators
PHP Operators
 PHP Array Operators Example:
PHP Conditional Statements
 In PHP we have the following conditional
statements:
 if statement - executes some code only if a specified
condition is true
 if...else statement - executes some code if a
condition is true and another code if the condition is
false
 if...elseif....else statement - selects one of several
blocks of code to be executed
 switch statement - selects one of many blocks of
code to be executed
PHP Conditional Statements
 If else Example:
PHP Conditional Statements
 Switch example:
PHP Loops
 In PHP, we have the following looping
statements:
 while - loops through a block of code as long as the
specified condition is true
 do...while - loops through a block of code once, and
then repeats the loop as long as the specified
condition is true
 for - loops through a block of code a specified
number of times
 foreach - loops through a block of code for each
element in an array
PHP Loops
 PHP while Loop example:
PHP Loops
 PHP do...while Loop example:
PHP Loops
 PHP for Loop example:
PHP Loops
 PHP foreach Loop example:
PHP Functions
 A function is a block of statements that can be
used repeatedly in a program.
 A function will not execute immediately when a
page loads.
 A function will be executed by a call to the
function.
PHP Functions
 PHP function examples:
PHP Arrays
 An array is a special variable, which can hold
more than one value at a time.
 Example:
PHP Associative Arrays
 Associative arrays are arrays that use named
keys that you assign to them.
 Example:
PHP Sorting Arrays
 PHP array sort functions:
 sort() - sort arrays in ascending order
 rsort() - sort arrays in descending order
 asort() - sort associative arrays in ascending order,
according to the value
 ksort() - sort associative arrays in ascending order,
according to the key
 arsort() - sort associative arrays in descending order,
according to the value
 krsort() - sort associative arrays in descending order,
according to the key
Agenda
 Part III: PHP Form Handling
 PHP GET vs. POST
 PHP $_GET
 PHP $_POST
PHP Form Handling
 One of the most powerful features of PHP is
the way it handles HTML forms. The basic
concept that is important to understand is
that any form element will automatically be
available to your PHP scripts.
 The PHP $_GET and $_POST are used to
collect form-data.
PHP GET vs. POST
 Both GET and POST create an array (e.g. array( key
=> value, key2 => value2, key3 => value3, ...)). This
array holds key/value pairs, where keys are the
names of the form controls and values are the input
data from the user.
 When to use GET?
 Information sent from a form with the GET method
is visible to everyone
 facebook.com?welcome.php?name=Mohamed
 When to use POST?
 Information sent from a form with the POST
method is invisible to others
 facebook.com?welcome.php
PHP $_GET
 Example:
PHP $_GET
 When the user fills out the form above and
clicks the submit button, the form data is sent
for processing to a PHP file named
"welcome.php".
 welcome.php
PHP $_GET
 Result:
 Welocome.php Output
PHP $_POST
 Example:
PHP $_POST
 When the user fills out the form above and
clicks the submit button, the form data is sent
for processing to a PHP file named
"welcome.php".
 welcome.php
PHP $_POST
 Result:
 Welocome.php Output
THANK U

More Related Content

What's hot

Welcome to computer programmer 2
Welcome to computer programmer 2Welcome to computer programmer 2
Welcome to computer programmer 2
MLG College of Learning, Inc
 
Basics PHP
Basics PHPBasics PHP
Constructor and encapsulation in php
Constructor and encapsulation in phpConstructor and encapsulation in php
Constructor and encapsulation in php
SHIVANI SONI
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
Anjan Banda
 
Chapter 02 php basic syntax
Chapter 02   php basic syntaxChapter 02   php basic syntax
Chapter 02 php basic syntax
Dhani Ahmad
 
Php a dynamic web scripting language
Php   a dynamic web scripting languagePhp   a dynamic web scripting language
Php a dynamic web scripting language
Elmer Concepcion Jr.
 
Php mysql
Php mysqlPhp mysql
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
Meetendra Singh
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
Nidhi mishra
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
KIRAN KUMAR SILIVERI
 
php basics
php basicsphp basics
php basics
Anmol Paul
 
Php
PhpPhp
Php(report)
Php(report)Php(report)
Php(report)Yhannah
 
Dev traning 2016 basics of PHP
Dev traning 2016   basics of PHPDev traning 2016   basics of PHP
Dev traning 2016 basics of PHP
Sacheen Dhanjie
 
Php tutorial(w3schools)
Php tutorial(w3schools)Php tutorial(w3schools)
Php tutorial(w3schools)Arjun Shanka
 
PHP
PHPPHP

What's hot (20)

Welcome to computer programmer 2
Welcome to computer programmer 2Welcome to computer programmer 2
Welcome to computer programmer 2
 
Basics PHP
Basics PHPBasics PHP
Basics PHP
 
Constructor and encapsulation in php
Constructor and encapsulation in phpConstructor and encapsulation in php
Constructor and encapsulation in php
 
php_tizag_tutorial
php_tizag_tutorialphp_tizag_tutorial
php_tizag_tutorial
 
Php introduction
Php introductionPhp introduction
Php introduction
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Control Structures In Php 2
Control Structures In Php 2Control Structures In Php 2
Control Structures In Php 2
 
Chapter 02 php basic syntax
Chapter 02   php basic syntaxChapter 02   php basic syntax
Chapter 02 php basic syntax
 
Php a dynamic web scripting language
Php   a dynamic web scripting languagePhp   a dynamic web scripting language
Php a dynamic web scripting language
 
Php mysql
Php mysqlPhp mysql
Php mysql
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
 
Introduction to php basics
Introduction to php   basicsIntroduction to php   basics
Introduction to php basics
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
php basics
php basicsphp basics
php basics
 
Php
PhpPhp
Php
 
Php(report)
Php(report)Php(report)
Php(report)
 
Dev traning 2016 basics of PHP
Dev traning 2016   basics of PHPDev traning 2016   basics of PHP
Dev traning 2016 basics of PHP
 
Php tutorial(w3schools)
Php tutorial(w3schools)Php tutorial(w3schools)
Php tutorial(w3schools)
 
PHP
PHPPHP
PHP
 

Viewers also liked

Php Coding Convention
Php Coding ConventionPhp Coding Convention
Php Coding Convention
Phuong Vy
 
PHP FUNCTIONS
PHP FUNCTIONSPHP FUNCTIONS
PHP FUNCTIONS
Zeeshan Ahmed
 
كيف تحمي خصوصيتك علي مواقع التواصل الاجتماعي فيسبوك
كيف تحمي خصوصيتك علي مواقع التواصل الاجتماعي فيسبوككيف تحمي خصوصيتك علي مواقع التواصل الاجتماعي فيسبوك
كيف تحمي خصوصيتك علي مواقع التواصل الاجتماعي فيسبوك
Mohamed Loey
 
Even internet computers want to be free: Using Linux and open source software...
Even internet computers want to be free: Using Linux and open source software...Even internet computers want to be free: Using Linux and open source software...
Even internet computers want to be free: Using Linux and open source software...
North Bend Public Library
 
MySQL and its basic commands
MySQL and its basic commandsMySQL and its basic commands
MySQL and its basic commands
Bwsrang Basumatary
 
Php variables (english)
Php variables (english)Php variables (english)
Php variables (english)
Mahmoud Masih Tehrani
 
Font
FontFont
Php File Operations
Php File OperationsPhp File Operations
Php File Operationsmussawir20
 
OOPS Characteristics (With Examples in PHP)
OOPS Characteristics (With Examples in PHP)OOPS Characteristics (With Examples in PHP)
OOPS Characteristics (With Examples in PHP)
baabtra.com - No. 1 supplier of quality freshers
 
Computer Security Lecture 4: Block Ciphers and the Data Encryption Standard
Computer Security Lecture 4: Block Ciphers and the Data Encryption StandardComputer Security Lecture 4: Block Ciphers and the Data Encryption Standard
Computer Security Lecture 4: Block Ciphers and the Data Encryption Standard
Mohamed Loey
 
Computer Security Lecture 3: Classical Encryption Techniques 2
Computer Security Lecture 3: Classical Encryption Techniques 2Computer Security Lecture 3: Classical Encryption Techniques 2
Computer Security Lecture 3: Classical Encryption Techniques 2
Mohamed Loey
 
Execute MySQL query using command prompt
Execute MySQL query using command promptExecute MySQL query using command prompt
Execute MySQL query using command promptIkhwan Krisnadi
 
What's new in PHP 7.1
What's new in PHP 7.1What's new in PHP 7.1
What's new in PHP 7.1
Simon Jones
 
Form Processing In Php
Form Processing In PhpForm Processing In Php
Form Processing In PhpHarit Kothari
 

Viewers also liked (20)

MySql slides (ppt)
MySql slides (ppt)MySql slides (ppt)
MySql slides (ppt)
 
Php Coding Convention
Php Coding ConventionPhp Coding Convention
Php Coding Convention
 
Coding In Php
Coding In PhpCoding In Php
Coding In Php
 
PHP FUNCTIONS
PHP FUNCTIONSPHP FUNCTIONS
PHP FUNCTIONS
 
كيف تحمي خصوصيتك علي مواقع التواصل الاجتماعي فيسبوك
كيف تحمي خصوصيتك علي مواقع التواصل الاجتماعي فيسبوككيف تحمي خصوصيتك علي مواقع التواصل الاجتماعي فيسبوك
كيف تحمي خصوصيتك علي مواقع التواصل الاجتماعي فيسبوك
 
Introduction to php web programming - sessions and cookies
Introduction to php   web programming - sessions and cookiesIntroduction to php   web programming - sessions and cookies
Introduction to php web programming - sessions and cookies
 
Even internet computers want to be free: Using Linux and open source software...
Even internet computers want to be free: Using Linux and open source software...Even internet computers want to be free: Using Linux and open source software...
Even internet computers want to be free: Using Linux and open source software...
 
MySQL and its basic commands
MySQL and its basic commandsMySQL and its basic commands
MySQL and its basic commands
 
Php variables (english)
Php variables (english)Php variables (english)
Php variables (english)
 
Font
FontFont
Font
 
Php File Operations
Php File OperationsPhp File Operations
Php File Operations
 
OOPS Characteristics (With Examples in PHP)
OOPS Characteristics (With Examples in PHP)OOPS Characteristics (With Examples in PHP)
OOPS Characteristics (With Examples in PHP)
 
Htmltag.ppt
Htmltag.pptHtmltag.ppt
Htmltag.ppt
 
Computer Security Lecture 4: Block Ciphers and the Data Encryption Standard
Computer Security Lecture 4: Block Ciphers and the Data Encryption StandardComputer Security Lecture 4: Block Ciphers and the Data Encryption Standard
Computer Security Lecture 4: Block Ciphers and the Data Encryption Standard
 
Arrays in PHP
Arrays in PHPArrays in PHP
Arrays in PHP
 
Computer Security Lecture 3: Classical Encryption Techniques 2
Computer Security Lecture 3: Classical Encryption Techniques 2Computer Security Lecture 3: Classical Encryption Techniques 2
Computer Security Lecture 3: Classical Encryption Techniques 2
 
Execute MySQL query using command prompt
Execute MySQL query using command promptExecute MySQL query using command prompt
Execute MySQL query using command prompt
 
What's new in PHP 7.1
What's new in PHP 7.1What's new in PHP 7.1
What's new in PHP 7.1
 
Php ppt
Php pptPhp ppt
Php ppt
 
Form Processing In Php
Form Processing In PhpForm Processing In Php
Form Processing In Php
 

Similar to PHP Comprehensive Overview

Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPIntroduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHP
wahidullah mudaser
 
chapter Two Server-side Script lang.pptx
chapter  Two Server-side Script lang.pptxchapter  Two Server-side Script lang.pptx
chapter Two Server-side Script lang.pptx
alehegn9
 
PHP Basic & Variables
PHP Basic & VariablesPHP Basic & Variables
PHP Basic & Variables
M.Zalmai Rahmani
 
PHP Training Part1
PHP Training Part1PHP Training Part1
PHP Training Part1
than sare
 
Php i-slides
Php i-slidesPhp i-slides
Php i-slides
ravi18011991
 
Php i-slides (2) (1)
Php i-slides (2) (1)Php i-slides (2) (1)
Php i-slides (2) (1)
ravi18011991
 
Php i-slides
Php i-slidesPhp i-slides
Php i-slides
Abu Bakar
 
Php i-slides
Php i-slidesPhp i-slides
Php i-slides
zalatarunk
 
php41.ppt
php41.pptphp41.ppt
php41.ppt
Nishant804733
 
PHP InterLevel.ppt
PHP InterLevel.pptPHP InterLevel.ppt
PHP InterLevel.ppt
NBACriteria2SICET
 
php-I-slides.ppt
php-I-slides.pptphp-I-slides.ppt
php-I-slides.ppt
SsewankamboErma
 
Php by shivitomer
Php by shivitomerPhp by shivitomer
Php by shivitomer
Shivi Tomer
 
Php Unit 1
Php Unit 1Php Unit 1
Php Unit 1
team11vgnt
 
Programming in PHP Course Material BCA 6th Semester
Programming in PHP Course Material BCA 6th SemesterProgramming in PHP Course Material BCA 6th Semester
Programming in PHP Course Material BCA 6th Semester
SanthiNivas
 
PHP - Introduction to PHP - Mazenet Solution
PHP - Introduction to PHP - Mazenet SolutionPHP - Introduction to PHP - Mazenet Solution
PHP - Introduction to PHP - Mazenet Solution
Mazenetsolution
 
Introduction to PHP.ppt
Introduction to PHP.pptIntroduction to PHP.ppt
Introduction to PHP.ppt
SanthiNivas
 
chapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdfchapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdf
burasyacob012
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
Taha Malampatti
 
Php web development
Php web developmentPhp web development
Php web development
Ramesh Gupta
 
Materi Dasar PHP
Materi Dasar PHPMateri Dasar PHP
Materi Dasar PHP
Robby Firmansyah
 

Similar to PHP Comprehensive Overview (20)

Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPIntroduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHP
 
chapter Two Server-side Script lang.pptx
chapter  Two Server-side Script lang.pptxchapter  Two Server-side Script lang.pptx
chapter Two Server-side Script lang.pptx
 
PHP Basic & Variables
PHP Basic & VariablesPHP Basic & Variables
PHP Basic & Variables
 
PHP Training Part1
PHP Training Part1PHP Training Part1
PHP Training Part1
 
Php i-slides
Php i-slidesPhp i-slides
Php i-slides
 
Php i-slides (2) (1)
Php i-slides (2) (1)Php i-slides (2) (1)
Php i-slides (2) (1)
 
Php i-slides
Php i-slidesPhp i-slides
Php i-slides
 
Php i-slides
Php i-slidesPhp i-slides
Php i-slides
 
php41.ppt
php41.pptphp41.ppt
php41.ppt
 
PHP InterLevel.ppt
PHP InterLevel.pptPHP InterLevel.ppt
PHP InterLevel.ppt
 
php-I-slides.ppt
php-I-slides.pptphp-I-slides.ppt
php-I-slides.ppt
 
Php by shivitomer
Php by shivitomerPhp by shivitomer
Php by shivitomer
 
Php Unit 1
Php Unit 1Php Unit 1
Php Unit 1
 
Programming in PHP Course Material BCA 6th Semester
Programming in PHP Course Material BCA 6th SemesterProgramming in PHP Course Material BCA 6th Semester
Programming in PHP Course Material BCA 6th Semester
 
PHP - Introduction to PHP - Mazenet Solution
PHP - Introduction to PHP - Mazenet SolutionPHP - Introduction to PHP - Mazenet Solution
PHP - Introduction to PHP - Mazenet Solution
 
Introduction to PHP.ppt
Introduction to PHP.pptIntroduction to PHP.ppt
Introduction to PHP.ppt
 
chapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdfchapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdf
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Php web development
Php web developmentPhp web development
Php web development
 
Materi Dasar PHP
Materi Dasar PHPMateri Dasar PHP
Materi Dasar PHP
 

More from Mohamed Loey

Lecture 6: Deep Learning Applications
Lecture 6: Deep Learning ApplicationsLecture 6: Deep Learning Applications
Lecture 6: Deep Learning Applications
Mohamed Loey
 
Lecture 5: Convolutional Neural Network Models
Lecture 5: Convolutional Neural Network ModelsLecture 5: Convolutional Neural Network Models
Lecture 5: Convolutional Neural Network Models
Mohamed Loey
 
Lecture 4: Deep Learning Frameworks
Lecture 4: Deep Learning FrameworksLecture 4: Deep Learning Frameworks
Lecture 4: Deep Learning Frameworks
Mohamed Loey
 
Lecture 4: How it Works: Convolutional Neural Networks
Lecture 4: How it Works: Convolutional Neural NetworksLecture 4: How it Works: Convolutional Neural Networks
Lecture 4: How it Works: Convolutional Neural Networks
Mohamed Loey
 
Lecture 3: Convolutional Neural Networks
Lecture 3: Convolutional Neural NetworksLecture 3: Convolutional Neural Networks
Lecture 3: Convolutional Neural Networks
Mohamed Loey
 
Lecture 2: Artificial Neural Network
Lecture 2: Artificial Neural NetworkLecture 2: Artificial Neural Network
Lecture 2: Artificial Neural Network
Mohamed Loey
 
Lecture 1: Deep Learning for Computer Vision
Lecture 1: Deep Learning for Computer VisionLecture 1: Deep Learning for Computer Vision
Lecture 1: Deep Learning for Computer Vision
Mohamed Loey
 
Design of an Intelligent System for Improving Classification of Cancer Diseases
Design of an Intelligent System for Improving Classification of Cancer DiseasesDesign of an Intelligent System for Improving Classification of Cancer Diseases
Design of an Intelligent System for Improving Classification of Cancer Diseases
Mohamed Loey
 
Computer Security - CCNA Security - Lecture 2
Computer Security - CCNA Security - Lecture 2Computer Security - CCNA Security - Lecture 2
Computer Security - CCNA Security - Lecture 2
Mohamed Loey
 
Computer Security - CCNA Security - Lecture 1
Computer Security - CCNA Security - Lecture 1Computer Security - CCNA Security - Lecture 1
Computer Security - CCNA Security - Lecture 1
Mohamed Loey
 
Algorithms Lecture 8: Pattern Algorithms
Algorithms Lecture 8: Pattern AlgorithmsAlgorithms Lecture 8: Pattern Algorithms
Algorithms Lecture 8: Pattern Algorithms
Mohamed Loey
 
Algorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph AlgorithmsAlgorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph Algorithms
Mohamed Loey
 
Algorithms Lecture 6: Searching Algorithms
Algorithms Lecture 6: Searching AlgorithmsAlgorithms Lecture 6: Searching Algorithms
Algorithms Lecture 6: Searching Algorithms
Mohamed Loey
 
Algorithms Lecture 5: Sorting Algorithms II
Algorithms Lecture 5: Sorting Algorithms IIAlgorithms Lecture 5: Sorting Algorithms II
Algorithms Lecture 5: Sorting Algorithms II
Mohamed Loey
 
Algorithms Lecture 4: Sorting Algorithms I
Algorithms Lecture 4: Sorting Algorithms IAlgorithms Lecture 4: Sorting Algorithms I
Algorithms Lecture 4: Sorting Algorithms I
Mohamed Loey
 
Algorithms Lecture 3: Analysis of Algorithms II
Algorithms Lecture 3: Analysis of Algorithms IIAlgorithms Lecture 3: Analysis of Algorithms II
Algorithms Lecture 3: Analysis of Algorithms II
Mohamed Loey
 
Algorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms IAlgorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms I
Mohamed Loey
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to Algorithms
Mohamed Loey
 
Convolutional Neural Network Models - Deep Learning
Convolutional Neural Network Models - Deep LearningConvolutional Neural Network Models - Deep Learning
Convolutional Neural Network Models - Deep Learning
Mohamed Loey
 
Deep Learning - Overview of my work II
Deep Learning - Overview of my work IIDeep Learning - Overview of my work II
Deep Learning - Overview of my work II
Mohamed Loey
 

More from Mohamed Loey (20)

Lecture 6: Deep Learning Applications
Lecture 6: Deep Learning ApplicationsLecture 6: Deep Learning Applications
Lecture 6: Deep Learning Applications
 
Lecture 5: Convolutional Neural Network Models
Lecture 5: Convolutional Neural Network ModelsLecture 5: Convolutional Neural Network Models
Lecture 5: Convolutional Neural Network Models
 
Lecture 4: Deep Learning Frameworks
Lecture 4: Deep Learning FrameworksLecture 4: Deep Learning Frameworks
Lecture 4: Deep Learning Frameworks
 
Lecture 4: How it Works: Convolutional Neural Networks
Lecture 4: How it Works: Convolutional Neural NetworksLecture 4: How it Works: Convolutional Neural Networks
Lecture 4: How it Works: Convolutional Neural Networks
 
Lecture 3: Convolutional Neural Networks
Lecture 3: Convolutional Neural NetworksLecture 3: Convolutional Neural Networks
Lecture 3: Convolutional Neural Networks
 
Lecture 2: Artificial Neural Network
Lecture 2: Artificial Neural NetworkLecture 2: Artificial Neural Network
Lecture 2: Artificial Neural Network
 
Lecture 1: Deep Learning for Computer Vision
Lecture 1: Deep Learning for Computer VisionLecture 1: Deep Learning for Computer Vision
Lecture 1: Deep Learning for Computer Vision
 
Design of an Intelligent System for Improving Classification of Cancer Diseases
Design of an Intelligent System for Improving Classification of Cancer DiseasesDesign of an Intelligent System for Improving Classification of Cancer Diseases
Design of an Intelligent System for Improving Classification of Cancer Diseases
 
Computer Security - CCNA Security - Lecture 2
Computer Security - CCNA Security - Lecture 2Computer Security - CCNA Security - Lecture 2
Computer Security - CCNA Security - Lecture 2
 
Computer Security - CCNA Security - Lecture 1
Computer Security - CCNA Security - Lecture 1Computer Security - CCNA Security - Lecture 1
Computer Security - CCNA Security - Lecture 1
 
Algorithms Lecture 8: Pattern Algorithms
Algorithms Lecture 8: Pattern AlgorithmsAlgorithms Lecture 8: Pattern Algorithms
Algorithms Lecture 8: Pattern Algorithms
 
Algorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph AlgorithmsAlgorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph Algorithms
 
Algorithms Lecture 6: Searching Algorithms
Algorithms Lecture 6: Searching AlgorithmsAlgorithms Lecture 6: Searching Algorithms
Algorithms Lecture 6: Searching Algorithms
 
Algorithms Lecture 5: Sorting Algorithms II
Algorithms Lecture 5: Sorting Algorithms IIAlgorithms Lecture 5: Sorting Algorithms II
Algorithms Lecture 5: Sorting Algorithms II
 
Algorithms Lecture 4: Sorting Algorithms I
Algorithms Lecture 4: Sorting Algorithms IAlgorithms Lecture 4: Sorting Algorithms I
Algorithms Lecture 4: Sorting Algorithms I
 
Algorithms Lecture 3: Analysis of Algorithms II
Algorithms Lecture 3: Analysis of Algorithms IIAlgorithms Lecture 3: Analysis of Algorithms II
Algorithms Lecture 3: Analysis of Algorithms II
 
Algorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms IAlgorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms I
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to Algorithms
 
Convolutional Neural Network Models - Deep Learning
Convolutional Neural Network Models - Deep LearningConvolutional Neural Network Models - Deep Learning
Convolutional Neural Network Models - Deep Learning
 
Deep Learning - Overview of my work II
Deep Learning - Overview of my work IIDeep Learning - Overview of my work II
Deep Learning - Overview of my work II
 

Recently uploaded

FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 

PHP Comprehensive Overview

  • 2. Agenda  Part I: Introduction  Part II: PHP Syntax  Part III: PHP Form Handling
  • 3. Agenda  Part I: Introduction  What is PHP?  Why we use PHP?  PHP Can  Set Up PHP on Your Own PC
  • 4. What is PHP?  PHP is a server scripting language, and is a powerful tool for making dynamic and interactive Web pages quickly.  PHP is a widely-used, open source scripting language  PHP scripts are executed on the server  PHP costs nothing, it is free to download and use
  • 5. Why we use PHP?  PHP runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)  PHP is compatible with almost all servers used today (Apache, IIS, etc.)  PHP supports a wide range of databases  PHP is easy to learn and runs efficiently on the server side  It is powerful enough to be at the core of the biggest blogging system on the web (WordPress)!  It is deep enough to run the largest social network (Facebook)!
  • 6. PHP Can  Generate dynamic page content  Create, open, read, write, delete, and close files on the server  Send and receive cookies  Add, delete, modify data in your database  Encrypt data  Output images, PDF files, and even Flash movies
  • 7. Set Up PHP on Your Own PC  Install a web server (Apache)  Install PHP  Install a database, such as MySQL  Example: XAMPP (Apache + MySQL + PHP + Perl)  XAMPP is the most popular PHP development environment
  • 8. Agenda  Part II: PHP Syntax  PHP Syntax  Comments in PHP  PHP Case Sensitivity  PHP Variables  PHP echo and print Statements  PHP Operators  PHP Conditional Statements  PHP Loops  PHP Functions  PHP Arrays
  • 9. PHP Syntax  PHP script can be placed anywhere in the document.  A PHP script starts with <?php and ends with ?>  The default file extension for PHP files is ".php".
  • 11. Comments in PHP  A comment in PHP code is a line that is not read/executed as part of the program.  PHP supports three ways of commenting:
  • 12. PHP Case Sensitivity  In PHP, all user-defined functions, classes, and keywords (e.g. if, else, while, echo, etc.) are NOT case- sensitive.  Example:
  • 13. PHP Case Sensitivity  However; in PHP, all variables are case- sensitive.  $color, $COLOR, and $coLOR are treated as three different variables  Example:
  • 14. PHP Variables  Variables are "containers" for storing information.  A variable starts with the $ sign, followed by the name of the variable  A variable name must start with a letter or the underscore character  A variable name cannot start with a number  A variable name can only contain alpha- numeric characters and underscores (A-z, 0-9, and _ )  Variable names are case sensitive ($y and $Y are two different variables)
  • 15. PHP Variables  PHP has no command for declaring a variable.  Example:
  • 16. PHP echo and print Statements  In PHP there are two basic ways to get output: echo and print.  There are some differences between echo and print:  echo - can output one or more strings  print - can only output one string, and returns always 1  Example:
  • 17. PHP Operators  PHP Arithmetic Operators
  • 18. PHP Operators  PHP Arithmetic Operators Example:
  • 19. PHP Operators  PHP Assignment Operators
  • 20. PHP Operators  PHP Assignment Operators Example:
  • 21. PHP Operators  PHP String Operators
  • 22. PHP Operators  PHP String Operators Example:
  • 23. PHP Operators  PHP Increment / Decrement Operators
  • 24. PHP Operators  PHP Increment / Decrement Operators Example:
  • 25. PHP Operators  PHP Comparison Operators
  • 26. PHP Operators  PHP Comparison Operators Example:
  • 27. PHP Operators  PHP Logical Operators
  • 28. PHP Operators  PHP Array Operators
  • 29. PHP Operators  PHP Array Operators Example:
  • 30. PHP Conditional Statements  In PHP we have the following conditional statements:  if statement - executes some code only if a specified condition is true  if...else statement - executes some code if a condition is true and another code if the condition is false  if...elseif....else statement - selects one of several blocks of code to be executed  switch statement - selects one of many blocks of code to be executed
  • 31. PHP Conditional Statements  If else Example:
  • 33. PHP Loops  In PHP, we have the following looping statements:  while - loops through a block of code as long as the specified condition is true  do...while - loops through a block of code once, and then repeats the loop as long as the specified condition is true  for - loops through a block of code a specified number of times  foreach - loops through a block of code for each element in an array
  • 34. PHP Loops  PHP while Loop example:
  • 35. PHP Loops  PHP do...while Loop example:
  • 36. PHP Loops  PHP for Loop example:
  • 37. PHP Loops  PHP foreach Loop example:
  • 38. PHP Functions  A function is a block of statements that can be used repeatedly in a program.  A function will not execute immediately when a page loads.  A function will be executed by a call to the function.
  • 39. PHP Functions  PHP function examples:
  • 40. PHP Arrays  An array is a special variable, which can hold more than one value at a time.  Example:
  • 41. PHP Associative Arrays  Associative arrays are arrays that use named keys that you assign to them.  Example:
  • 42. PHP Sorting Arrays  PHP array sort functions:  sort() - sort arrays in ascending order  rsort() - sort arrays in descending order  asort() - sort associative arrays in ascending order, according to the value  ksort() - sort associative arrays in ascending order, according to the key  arsort() - sort associative arrays in descending order, according to the value  krsort() - sort associative arrays in descending order, according to the key
  • 43. Agenda  Part III: PHP Form Handling  PHP GET vs. POST  PHP $_GET  PHP $_POST
  • 44. PHP Form Handling  One of the most powerful features of PHP is the way it handles HTML forms. The basic concept that is important to understand is that any form element will automatically be available to your PHP scripts.  The PHP $_GET and $_POST are used to collect form-data.
  • 45. PHP GET vs. POST  Both GET and POST create an array (e.g. array( key => value, key2 => value2, key3 => value3, ...)). This array holds key/value pairs, where keys are the names of the form controls and values are the input data from the user.  When to use GET?  Information sent from a form with the GET method is visible to everyone  facebook.com?welcome.php?name=Mohamed  When to use POST?  Information sent from a form with the POST method is invisible to others  facebook.com?welcome.php
  • 47. PHP $_GET  When the user fills out the form above and clicks the submit button, the form data is sent for processing to a PHP file named "welcome.php".  welcome.php
  • 48. PHP $_GET  Result:  Welocome.php Output
  • 50. PHP $_POST  When the user fills out the form above and clicks the submit button, the form data is sent for processing to a PHP file named "welcome.php".  welcome.php
  • 51. PHP $_POST  Result:  Welocome.php Output