SlideShare a Scribd company logo
1 of 14
Introduction of PHP
By Umar Farooque Khan
http://www.ptutorial.com
What is PHP?
• PHP stand for hypertext pre-processor.
# PHP is a general purpose server side scripting language
that is basically used for web development.
# PHP script run on web server.
# PHP is used for dynamic web page creation.
# PHP run on GUI based operating system as well as
Command based .
#PHP can easily embedded with HTML.
#Its freely available.
http://www.ptutorial.com 3
Why PHP?
It’s fast
 It’s free
 It’s easy to use
 It’s versatile
 It’s secure
 It’s customizable
Interact with HTML forms
 Communicate with databases
 Generate secure Web pages
Easy to learn and implement.
http://www.ptutorial.com 4
Supported Databases
dBASE
 Informix
 Ingres
 Microsoft SQL Server
 mSQL
 MySQL
 Oracle
 PostgreSQL
 Sybase
http://www.ptutorial.com 5
Basic Syntax
<html>
<head>
<title>First Script of PHP</title>
</head>
<body>
<?php
echo “Welcome to the php word!";
echo “www.ptutorial.com”;
?>
</body>
</html>
http://www.ptutorial.com 6
Commenting in PHP
• PHP supports two type of commenting
1. Single line comment
<?php
echo “Comment in php"; // Single line Comment
#this also a single line comment
echo “www.ptutorial.com";
?>
http://www.ptutorial.com 7
Commenting continued in PHP
2. Multi line Comment
<?php
echo “Comment in php“;
echo “Multiple line comment";
/* this multi line comment
You can put any number of line */
echo “www.ptutorial.com";
?>
http://www.ptutorial.com 8
Echo Statement
• In PHP echo statement is used for deliver the string as well as variable
value on the browse, Following example explain the concept of echo
statement.
<?php
echo “Welcome to the php word!";
$number=38;
echo $number;
$str=“www.ptutorial.com”;
Echo $str;
?>
http://www.ptutorial.com 9
The Semicolon and Case Sensitivity
Every statement must be terminated with semicolon.
In PHP functions, classes, core language keywords are case-
insensitive.
<?php
echo “Welcome to the php word!";
Echo “www.ptutorial.com”; //case insensitive
?>
http://www.ptutorial.com 10
PHP Variables
Variables are just identifier that are used for storing data, like integer,
float, strings, arrays.
In PHP there is no need to declare before use.
Dollar sign is used at the time of making variable.
http://www.ptutorial.com 11
Rules of making PHP variable
It must be starts with dollar($) sign.
A valid variable name start with string or underscore after
dollar sign.
PHP variable can any length.
PHP variables are case sensitive.
http://www.ptutorial.com 12
Example of valid variable
$name=52;
$name_1=12;
$var145af=102;
$_php=586;
$a145=“java”;
$first_name_1=4875;
http://www.ptutorial.com 13
Example of PHP Variable
<?php
$txt=“www.ptutorial.com!";
$Number=152;
$a=18.5;
Echo $number . $a;
?>
http://www.ptutorial.com 14

More Related Content

What's hot (20)

PHP
PHPPHP
PHP
 
Php mysql
Php mysqlPhp mysql
Php mysql
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
 
Php introduction
Php introductionPhp introduction
Php introduction
 
Php
PhpPhp
Php
 
Chapter 02 php basic syntax
Chapter 02   php basic syntaxChapter 02   php basic syntax
Chapter 02 php basic syntax
 
PHP NOTES FOR BEGGINERS
PHP NOTES FOR BEGGINERSPHP NOTES FOR BEGGINERS
PHP NOTES FOR BEGGINERS
 
Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
PHP
PHPPHP
PHP
 
Php
PhpPhp
Php
 
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
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Php basics
Php basicsPhp basics
Php basics
 
Control Structures In Php 2
Control Structures In Php 2Control Structures In Php 2
Control Structures In Php 2
 
PHP Loops and PHP Forms
PHP  Loops and PHP FormsPHP  Loops and PHP Forms
PHP Loops and PHP Forms
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Basics PHP
Basics PHPBasics PHP
Basics PHP
 
Php mysql
Php mysqlPhp mysql
Php mysql
 

Viewers also liked

Pemrograman Web with PHP MySQL
Pemrograman Web with PHP MySQLPemrograman Web with PHP MySQL
Pemrograman Web with PHP MySQLdjokotingkir999
 
PHP7 - For Its Best Performance
PHP7 - For Its Best PerformancePHP7 - For Its Best Performance
PHP7 - For Its Best PerformanceXinchen Hui
 
PHP 7 – What changed internally?
PHP 7 – What changed internally?PHP 7 – What changed internally?
PHP 7 – What changed internally?Nikita Popov
 
PHP7.1 New Features & Performance
PHP7.1 New Features & PerformancePHP7.1 New Features & Performance
PHP7.1 New Features & PerformanceXinchen Hui
 
PHP7 - The New Engine for old good train
PHP7 - The New Engine for old good trainPHP7 - The New Engine for old good train
PHP7 - The New Engine for old good trainXinchen Hui
 
Modul praktikum javascript
Modul praktikum javascriptModul praktikum javascript
Modul praktikum javascripthardyta
 
Perl programming language
Perl programming languagePerl programming language
Perl programming languageElie Obeid
 
PHP 7 Crash Course - php[world] 2015
PHP 7 Crash Course - php[world] 2015PHP 7 Crash Course - php[world] 2015
PHP 7 Crash Course - php[world] 2015Colin O'Dell
 
Last train to php 7
Last train to php 7Last train to php 7
Last train to php 7Damien Seguy
 

Viewers also liked (15)

Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
 
Pemrograman Web with PHP MySQL
Pemrograman Web with PHP MySQLPemrograman Web with PHP MySQL
Pemrograman Web with PHP MySQL
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
 
SQL -PHP Tutorial
SQL -PHP TutorialSQL -PHP Tutorial
SQL -PHP Tutorial
 
PHP7 - For Its Best Performance
PHP7 - For Its Best PerformancePHP7 - For Its Best Performance
PHP7 - For Its Best Performance
 
PHP 7 – What changed internally?
PHP 7 – What changed internally?PHP 7 – What changed internally?
PHP 7 – What changed internally?
 
PHP7.1 New Features & Performance
PHP7.1 New Features & PerformancePHP7.1 New Features & Performance
PHP7.1 New Features & Performance
 
PHP7 - The New Engine for old good train
PHP7 - The New Engine for old good trainPHP7 - The New Engine for old good train
PHP7 - The New Engine for old good train
 
Modul praktikum javascript
Modul praktikum javascriptModul praktikum javascript
Modul praktikum javascript
 
Perl programming language
Perl programming languagePerl programming language
Perl programming language
 
PHP 7
PHP 7PHP 7
PHP 7
 
PHP 7 Crash Course - php[world] 2015
PHP 7 Crash Course - php[world] 2015PHP 7 Crash Course - php[world] 2015
PHP 7 Crash Course - php[world] 2015
 
Last train to php 7
Last train to php 7Last train to php 7
Last train to php 7
 
Php Presentation
Php PresentationPhp Presentation
Php Presentation
 
Php mysql ppt
Php mysql pptPhp mysql ppt
Php mysql ppt
 

Similar to PHP tutorial | ptutorial (20)

Php unit i
Php unit iPhp unit i
Php unit i
 
Php
PhpPhp
Php
 
PHP - Introduction to PHP Fundamentals
PHP -  Introduction to PHP FundamentalsPHP -  Introduction to PHP Fundamentals
PHP - Introduction to PHP Fundamentals
 
Php1
Php1Php1
Php1
 
Web Application Development using PHP Chapter 1
Web Application Development using PHP Chapter 1Web Application Development using PHP Chapter 1
Web Application Development using PHP Chapter 1
 
Php tutorialw3schools
Php tutorialw3schoolsPhp tutorialw3schools
Php tutorialw3schools
 
PHP.docx
PHP.docxPHP.docx
PHP.docx
 
Php1
Php1Php1
Php1
 
Materi Dasar PHP
Materi Dasar PHPMateri Dasar PHP
Materi Dasar PHP
 
Php1
Php1Php1
Php1
 
Php1
Php1Php1
Php1
 
1. introduction to php and variable
1. introduction to php and variable1. introduction to php and variable
1. introduction to php and variable
 
Php tizag tutorial
Php tizag tutorialPhp tizag tutorial
Php tizag tutorial
 
PHP learning
PHP learningPHP learning
PHP learning
 
php_tizag_tutorial
php_tizag_tutorialphp_tizag_tutorial
php_tizag_tutorial
 
Php tizag tutorial
Php tizag tutorial Php tizag tutorial
Php tizag tutorial
 
php_tizag_tutorial
php_tizag_tutorialphp_tizag_tutorial
php_tizag_tutorial
 
Php tizag tutorial
Php tizag tutorialPhp tizag tutorial
Php tizag tutorial
 
Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
 
Introduction to-php
Introduction to-phpIntroduction to-php
Introduction to-php
 

Recently uploaded

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 

Recently uploaded (20)

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 

PHP tutorial | ptutorial

  • 1. Introduction of PHP By Umar Farooque Khan http://www.ptutorial.com
  • 2.
  • 3. What is PHP? • PHP stand for hypertext pre-processor. # PHP is a general purpose server side scripting language that is basically used for web development. # PHP script run on web server. # PHP is used for dynamic web page creation. # PHP run on GUI based operating system as well as Command based . #PHP can easily embedded with HTML. #Its freely available. http://www.ptutorial.com 3
  • 4. Why PHP? It’s fast  It’s free  It’s easy to use  It’s versatile  It’s secure  It’s customizable Interact with HTML forms  Communicate with databases  Generate secure Web pages Easy to learn and implement. http://www.ptutorial.com 4
  • 5. Supported Databases dBASE  Informix  Ingres  Microsoft SQL Server  mSQL  MySQL  Oracle  PostgreSQL  Sybase http://www.ptutorial.com 5
  • 6. Basic Syntax <html> <head> <title>First Script of PHP</title> </head> <body> <?php echo “Welcome to the php word!"; echo “www.ptutorial.com”; ?> </body> </html> http://www.ptutorial.com 6
  • 7. Commenting in PHP • PHP supports two type of commenting 1. Single line comment <?php echo “Comment in php"; // Single line Comment #this also a single line comment echo “www.ptutorial.com"; ?> http://www.ptutorial.com 7
  • 8. Commenting continued in PHP 2. Multi line Comment <?php echo “Comment in php“; echo “Multiple line comment"; /* this multi line comment You can put any number of line */ echo “www.ptutorial.com"; ?> http://www.ptutorial.com 8
  • 9. Echo Statement • In PHP echo statement is used for deliver the string as well as variable value on the browse, Following example explain the concept of echo statement. <?php echo “Welcome to the php word!"; $number=38; echo $number; $str=“www.ptutorial.com”; Echo $str; ?> http://www.ptutorial.com 9
  • 10. The Semicolon and Case Sensitivity Every statement must be terminated with semicolon. In PHP functions, classes, core language keywords are case- insensitive. <?php echo “Welcome to the php word!"; Echo “www.ptutorial.com”; //case insensitive ?> http://www.ptutorial.com 10
  • 11. PHP Variables Variables are just identifier that are used for storing data, like integer, float, strings, arrays. In PHP there is no need to declare before use. Dollar sign is used at the time of making variable. http://www.ptutorial.com 11
  • 12. Rules of making PHP variable It must be starts with dollar($) sign. A valid variable name start with string or underscore after dollar sign. PHP variable can any length. PHP variables are case sensitive. http://www.ptutorial.com 12
  • 13. Example of valid variable $name=52; $name_1=12; $var145af=102; $_php=586; $a145=“java”; $first_name_1=4875; http://www.ptutorial.com 13
  • 14. Example of PHP Variable <?php $txt=“www.ptutorial.com!"; $Number=152; $a=18.5; Echo $number . $a; ?> http://www.ptutorial.com 14