SlideShare une entreprise Scribd logo
1  sur  19
PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced
PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced
Agenda
What is PHP? Why learn PHP? PHP Fundamentals
PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced
Let’s Cover Basics First!
PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced
What is PHP?
PHP is a server side scripting language, and a powerful tool for making dynamic
and interactive Web pages
Hypertext Pre-processor Used for server side logic
PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced
What can PHP do?
Dynamic
Pages
Collect Form Data
Data
Encryption
• Easy to Learn
• Supports different types of DB
• Cross Platform
• Supports multiple server types
PHP Features
Create Read Update Delete
PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced
PHP Fundamentals
PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced
Variables
Memory location
Variable name
Variable is a name given to a memory location which acts as a container for storing data.
Syntax:
1 $age = 22;
PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced
Constants
Constants are fixed values that do not change during execution time.
Syntax:
define ('PI', 3.1415926);
Examples of constants
PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced
Primitive Data Types
Strings Boolean
TRUE
FALSE
Integers
Float Undefined
1.8456
Hello World
PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced
Reference Data Types - Arrays
0 1 2 3 4
An array is a data structure that contains a list of elements. These elements are all of the
same data type, such as an integer or string.
Syntax:
1
2
$chocolates = array(‘Eclairs', 'Mars', 'KitKat');
PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced
Reference Data Types - Functions
A function is a block of organized, reusable code that is used to perform a single, related action.
Functions
Predefined
Functions
User Defined
Functions
Syntax:
1
2
3
function addNumbers($num1, $num2){
return $num1 + $num2;
name of the function enter parameters here
PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced
Conditional Statements
Conditional statement is a set of rules performed if a certain condition is met. It is like an
‘If-Then’ statement. (IF a condition is met, THEN an action is performed)
If Statement
If code
End
Start
True
Condition
False
Exit
Syntax:
1
2
3
if(condition) {
statement;
}
PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced
Conditional Statements
Conditional statement is a set of rules performed if a certain condition is met. It is like an
‘If-Then’ statement. (IF a condition is met, THEN an action is performed)
Else If Statement
If code
End
Start
True
Condition
False
Else if code
Syntax:
1
2
3
4
5
6
if(condition) {
statement a;
}
else (condition) {
statement b;
}
PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced
Loops
Loops are used to repeat a specific block until some end condition is met.
Loops
do whilewhilefor
Start
Conditional Code
Condition
False
True
End loop
PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced
While Loop
While the condition is true, the code within the loop is executed.
Start
Conditional Code
End
True
False
Condition
While loop
Syntax:
1
2
3
while(condition) {
loop code;
}
PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced
Do While Loop
This loop will first execute the code, then check the condition and while
the condition holds true, execute repeatedly.
Start
Conditional Code
End
True
False
Condition
Do while loop
Syntax:
1
2
3
4
do {
loop code;
}
while(condition);
PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced
For Loop
Repeatedly executes the loop code while a given condition is TRUE. It
tests the condition before executing the loop body.
For loop
Start
Execute Statement (s)
End
Next item from
sequence
If no more itemsItem from
sequenceSyntax:
1
2
3
for(begin; condition; step) {
loop code;
}
PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced
Switch Case
The switch statement is used to perform
different actions based on different
conditions.
Syntax:
1
2
3
4
5
6
7
8
9
10
switch(expression) {
case 1 :
code block 1
break;
case 2 :
code block 2
break;
default :
code block 3
}
Start
Switch expression
End
Case 1
Case 2
Default
Code block 1
break;
Code block 2
break;
Default statement
False
False
PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced
WebDriver vs. IDE vs. RC
➢ Data Warehouse is like a relational database designed for analytical needs.
➢ It functions on the basis of OLAP (Online Analytical Processing).
➢ It is a central location where consolidated data from multiple locations (databases) are stored.

Contenu connexe

Plus de Edureka!

Plus de Edureka! (20)

How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| Edureka
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | Edureka
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | Edureka
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | Edureka
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | Edureka
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | Edureka
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | Edureka
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | Edureka
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | Edureka
 
ITIL® Tutorial for Beginners | ITIL® Foundation Training | Edureka
ITIL® Tutorial for Beginners | ITIL® Foundation Training | EdurekaITIL® Tutorial for Beginners | ITIL® Foundation Training | Edureka
ITIL® Tutorial for Beginners | ITIL® Foundation Training | Edureka
 
Difference between ITIL v3 and ITIL 4 | ITIL® Foundation Training | Edureka
Difference between ITIL v3 and ITIL 4 | ITIL® Foundation Training | EdurekaDifference between ITIL v3 and ITIL 4 | ITIL® Foundation Training | Edureka
Difference between ITIL v3 and ITIL 4 | ITIL® Foundation Training | Edureka
 
Jenkins vs Bamboo | Differences Between Jenkins and Bamboo | Edureka
Jenkins vs Bamboo | Differences Between Jenkins and Bamboo | EdurekaJenkins vs Bamboo | Differences Between Jenkins and Bamboo | Edureka
Jenkins vs Bamboo | Differences Between Jenkins and Bamboo | Edureka
 
What Is Digital Marketing? | Digital Marketing Tutorial | Edureka
What Is Digital Marketing? | Digital Marketing Tutorial | EdurekaWhat Is Digital Marketing? | Digital Marketing Tutorial | Edureka
What Is Digital Marketing? | Digital Marketing Tutorial | Edureka
 
What is JUnit? | Edureka
What is JUnit? | EdurekaWhat is JUnit? | Edureka
What is JUnit? | Edureka
 
Machine Learning in 10 Minutes | What is Machine Learning? | Edureka
Machine Learning in 10 Minutes | What is Machine Learning? | EdurekaMachine Learning in 10 Minutes | What is Machine Learning? | Edureka
Machine Learning in 10 Minutes | What is Machine Learning? | Edureka
 
Web Development Projects | Web Dev Project Ideas For Beginners | Edureka
Web Development Projects | Web Dev Project Ideas For Beginners | EdurekaWeb Development Projects | Web Dev Project Ideas For Beginners | Edureka
Web Development Projects | Web Dev Project Ideas For Beginners | Edureka
 
What's new in python 3.8? | Python 3.8 New Features | Edureka
What's new in python 3.8? | Python 3.8 New Features | EdurekaWhat's new in python 3.8? | Python 3.8 New Features | Edureka
What's new in python 3.8? | Python 3.8 New Features | Edureka
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Dernier (20)

ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 

PHP Programming Tutorial For Beginners | PHP Tutorial For Web Development | PHP Training | Edureka

  • 1. PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced
  • 2. PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced Agenda What is PHP? Why learn PHP? PHP Fundamentals
  • 3. PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced Let’s Cover Basics First!
  • 4. PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced What is PHP? PHP is a server side scripting language, and a powerful tool for making dynamic and interactive Web pages Hypertext Pre-processor Used for server side logic
  • 5. PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced What can PHP do? Dynamic Pages Collect Form Data Data Encryption • Easy to Learn • Supports different types of DB • Cross Platform • Supports multiple server types PHP Features Create Read Update Delete
  • 6. PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced PHP Fundamentals
  • 7. PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced Variables Memory location Variable name Variable is a name given to a memory location which acts as a container for storing data. Syntax: 1 $age = 22;
  • 8. PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced Constants Constants are fixed values that do not change during execution time. Syntax: define ('PI', 3.1415926); Examples of constants
  • 9. PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced Primitive Data Types Strings Boolean TRUE FALSE Integers Float Undefined 1.8456 Hello World
  • 10. PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced Reference Data Types - Arrays 0 1 2 3 4 An array is a data structure that contains a list of elements. These elements are all of the same data type, such as an integer or string. Syntax: 1 2 $chocolates = array(‘Eclairs', 'Mars', 'KitKat');
  • 11. PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced Reference Data Types - Functions A function is a block of organized, reusable code that is used to perform a single, related action. Functions Predefined Functions User Defined Functions Syntax: 1 2 3 function addNumbers($num1, $num2){ return $num1 + $num2; name of the function enter parameters here
  • 12. PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced Conditional Statements Conditional statement is a set of rules performed if a certain condition is met. It is like an ‘If-Then’ statement. (IF a condition is met, THEN an action is performed) If Statement If code End Start True Condition False Exit Syntax: 1 2 3 if(condition) { statement; }
  • 13. PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced Conditional Statements Conditional statement is a set of rules performed if a certain condition is met. It is like an ‘If-Then’ statement. (IF a condition is met, THEN an action is performed) Else If Statement If code End Start True Condition False Else if code Syntax: 1 2 3 4 5 6 if(condition) { statement a; } else (condition) { statement b; }
  • 14. PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced Loops Loops are used to repeat a specific block until some end condition is met. Loops do whilewhilefor Start Conditional Code Condition False True End loop
  • 15. PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced While Loop While the condition is true, the code within the loop is executed. Start Conditional Code End True False Condition While loop Syntax: 1 2 3 while(condition) { loop code; }
  • 16. PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced Do While Loop This loop will first execute the code, then check the condition and while the condition holds true, execute repeatedly. Start Conditional Code End True False Condition Do while loop Syntax: 1 2 3 4 do { loop code; } while(condition);
  • 17. PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced For Loop Repeatedly executes the loop code while a given condition is TRUE. It tests the condition before executing the loop body. For loop Start Execute Statement (s) End Next item from sequence If no more itemsItem from sequenceSyntax: 1 2 3 for(begin; condition; step) { loop code; }
  • 18. PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced Switch Case The switch statement is used to perform different actions based on different conditions. Syntax: 1 2 3 4 5 6 7 8 9 10 switch(expression) { case 1 : code block 1 break; case 2 : code block 2 break; default : code block 3 } Start Switch expression End Case 1 Case 2 Default Code block 1 break; Code block 2 break; Default statement False False
  • 19. PHP & MySQL Training https://www.edureka.co/php-mysql-self-paced WebDriver vs. IDE vs. RC ➢ Data Warehouse is like a relational database designed for analytical needs. ➢ It functions on the basis of OLAP (Online Analytical Processing). ➢ It is a central location where consolidated data from multiple locations (databases) are stored.