SlideShare a Scribd company logo
PHP
Server Side Scripting Language
Introduction Of PHP
 PHP is a recursive acronym for "PHP: Hypertext Preprocessor“ or “Personal
Home Page”.
 PHP is a server side scripting language that is embedded in HTML. It is used to
manage dynamic content, databases, session tracking, even build entire e-
commerce sites.
 It is integrated with a number of popular databases, including MySQL,
PostgreSQL, Oracle, blockchain, and Microsoft SQL Server.
Common use Of PHP
 PHP performs system functions, i.e. from files on a system it can create,
open, read, write, and close them.
 PHP can handle forms, i.e. gather data from files, save data to a file,
through email you can send data, return data to the user.
 You add, delete, modify elements within your database through PHP.
 Using PHP, you can restrict users to access some pages of your website.
 It can encrypt data.
Feature And Advantages of PHP
 Simple
 Interpreted
 Faster
 Open Source
 Platform Independent
 Efficiency
 Flexibility
What Can PHP Do?
 PHP can generate dynamic page content
 PHP can create, open, read, write, delete, and close files on the server
 PHP can collect form data
 PHP can send and receive cookies
 PHP can add, delete, modify data in your database
 PHP can be used to control user-access
 PHP can encrypt data
Why PHP?
 PHP runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)
 PHP is compatible with almost all servers used today (Apache)
 PHP supports a wide range of databases
 PHP is free PHP is easy to learn and runs efficiently on the server side
PHP Syntax
 A PHP Script is always executed at server side ,and browser gets the plain HTML
result in response.
 The Location of PHP Script can be anywhere in document in the document.
 The PHP Parsing engine requires a method to distinguish PHP code from other
script in the page. This is called escaping to PHP.
 The PHP Script start with <?php and ends with ?>
Syntax
<?php
PHP Statement;
?>
Extension Of PHP
 . Php is the extension for PHP Files.
 A PHP is Combination of PHP script with HTML Tags.
Simple Program to display Hello Message in PHP
 <?php
echo "<h2>PHP is Fun!</h2>";
echo "Hello world!<br>";
echo "I'm about to learn PHP!<br>";
echo "This ", "string ", "was ", "made ", "with multiple parameters.";
?>
The echo statement can be used with or without parentheses: echo or echo().
PHP Comments
<?php
// This is a single-line comment
# This is also a single-line comment
/*
This is a multiple-lines comment block
that spans over multiple
lines
*/
// You can also use comments to leave out parts of a code line
$x = 5 /* + 15 */ + 5;
echo $x;
?>
Variables in PHP
 Definition: A Variable is the Name Given to memory Location where we can
store some Value . The Value depends upon the data type of the variable.
 Declaration: In PHP we declare Variables by using “$ “ symbol without
assigning the data type. The Data type of variable is decided by the PHP
parsing engine when value is assigned to it.
Example of Variable Declaration
<?php
$txt = "Hello world!";
$x = 5;
$y = 10.5;
echo $txt;
echo "<br>";
echo $x;
echo "<br>";
echo $y;
?>
Addition Of two Numbers
<?php
$no1=12;
$no2=19;
$sum=$no1+$no2;
echo"Summation is:-".$sum;
?>
Conditions and Loops
Control Structure
If
If else
While
Do While
Else If ladder
Switch case
For
For each
Function
 The Concept Of Programing is Same of any other Programming Language.
 Definition: A function is a block of statements related to such a task which
we want to execute repeatedly in our program.
 A function can take arguments and also can return value.
 Up till now we have seen the function echo().
 This is built in function of php.
 Now We will create our own user defined function.
 Related to functions there are two important points:
 1Creating a PHP Function.
 2. Calling a PHP Function
Function Syntax
function function_name (parameters)
{
Statements;
}
Sample Program of function
<?php
function printmsg()
{
echo "hello welcome";
}
printmsg();
?>
Passing Arguments Through Function
<?php
function summation($n1,$n2)
{
$n3=$n1+$n2;
echo "Summation is:-".$n3;
}
summation(10,20);
?>
Passing Argument by Reference
<?php
function summation(&$num)
{
$num += 5;
}
$num=10;
echo "$num<br>";
summation($num);
echo "$num“;
?>
Form Handling
 When you login into a website or into your mail box, you are interacting
with a form.
 Forms are used to get input from the user and submit it to the web server for
processing.
 A form is an HTML tag that contains graphical user interface items such as
input box, check boxes radio buttons etc.
 The diagram below illustrates the form handling process.
PHP.pptx is the Best Explanation of ppts
THANK YOU

More Related Content

Similar to PHP.pptx is the Best Explanation of ppts (20)

Materi Dasar PHP
Materi Dasar PHPMateri Dasar PHP
Materi Dasar PHP
Robby Firmansyah
 
Php unit i
Php unit iPhp unit i
Php unit i
BagavathiLakshmi
 
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
Mohd Harris Ahmad Jaal
 
PHP NOTES FOR BEGGINERS
PHP NOTES FOR BEGGINERSPHP NOTES FOR BEGGINERS
PHP NOTES FOR BEGGINERS
Aminiel Michael
 
Basics PHP
Basics PHPBasics PHP
Basics PHP
Alokin Software Pvt Ltd
 
Introduction of PHP.pdf
Introduction of PHP.pdfIntroduction of PHP.pdf
Introduction of PHP.pdf
karinaabyys
 
Php
PhpPhp
Php
Shagufta shaheen
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
Nidhi mishra
 
Web Development Course: PHP lecture 1
Web Development Course: PHP lecture 1Web Development Course: PHP lecture 1
Web Development Course: PHP lecture 1
Gheyath M. Othman
 
WT_PHP_PART1.pdf
WT_PHP_PART1.pdfWT_PHP_PART1.pdf
WT_PHP_PART1.pdf
HambardeAtharva
 
Introduction to php basics
Introduction to php   basicsIntroduction to php   basics
Introduction to php basics
baabtra.com - No. 1 supplier of quality freshers
 
INTRODUCTION ON PHP - SERVER SIDE SCRIPTING LANGUAGE
INTRODUCTION ON PHP - SERVER SIDE SCRIPTING LANGUAGEINTRODUCTION ON PHP - SERVER SIDE SCRIPTING LANGUAGE
INTRODUCTION ON PHP - SERVER SIDE SCRIPTING LANGUAGE
PRIYADARSINIK3
 
PHP
PHPPHP
PHP
Steve Fort
 
INTRODUCTION TO PHP.ppt
INTRODUCTION TO PHP.pptINTRODUCTION TO PHP.ppt
INTRODUCTION TO PHP.ppt
WASIYANILOFARDPSNACH
 
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
 
INTRODUCTION to php.pptx
INTRODUCTION to php.pptxINTRODUCTION to php.pptx
INTRODUCTION to php.pptx
priyanshupanchal8
 
Php Unit 1
Php Unit 1Php Unit 1
Php Unit 1
team11vgnt
 
Lecture 6: Introduction to PHP and Mysql .pptx
Lecture 6:  Introduction to PHP and Mysql .pptxLecture 6:  Introduction to PHP and Mysql .pptx
Lecture 6: Introduction to PHP and Mysql .pptx
AOmaAli
 
Php assignment help
Php assignment helpPhp assignment help
Php assignment help
Jacob William
 
PHP
PHPPHP
PHP
sometech
 

More from AkhileshPansare (15)

Software Specifications with details exp
Software Specifications with details expSoftware Specifications with details exp
Software Specifications with details exp
AkhileshPansare
 
DOC-20230408-WA0002..pptx
DOC-20230408-WA0002..pptxDOC-20230408-WA0002..pptx
DOC-20230408-WA0002..pptx
AkhileshPansare
 
Ak.pdf
Ak.pdfAk.pdf
Ak.pdf
AkhileshPansare
 
pra Project pages ppt.
pra Project pages ppt.pra Project pages ppt.
pra Project pages ppt.
AkhileshPansare
 
IIM MICRO PROJE.pptx
IIM MICRO PROJE.pptxIIM MICRO PROJE.pptx
IIM MICRO PROJE.pptx
AkhileshPansare
 
Acc Project pages.pptx
Acc Project pages.pptxAcc Project pages.pptx
Acc Project pages.pptx
AkhileshPansare
 
BCC MICRO PROJECT.pptx
BCC MICRO PROJECT.pptxBCC MICRO PROJECT.pptx
BCC MICRO PROJECT.pptx
AkhileshPansare
 
DOC-20230408-WA0002..pptx
DOC-20230408-WA0002..pptxDOC-20230408-WA0002..pptx
DOC-20230408-WA0002..pptx
AkhileshPansare
 
DOC-20230408-WA0002..pptx
DOC-20230408-WA0002..pptxDOC-20230408-WA0002..pptx
DOC-20230408-WA0002..pptx
AkhileshPansare
 
Airbags in automobile.pptx
Airbags in automobile.pptxAirbags in automobile.pptx
Airbags in automobile.pptx
AkhileshPansare
 
EP848-PowerpointFa bearing.pptx
EP848-PowerpointFa bearing.pptxEP848-PowerpointFa bearing.pptx
EP848-PowerpointFa bearing.pptx
AkhileshPansare
 
EP848-PowerpointFa.pptx
EP848-PowerpointFa.pptxEP848-PowerpointFa.pptx
EP848-PowerpointFa.pptx
AkhileshPansare
 
Force and Motion PowerPoint.pdf
Force and Motion PowerPoint.pdfForce and Motion PowerPoint.pdf
Force and Motion PowerPoint.pdf
AkhileshPansare
 
Artificial%20Intelligence%20Introduction.pptx
Artificial%20Intelligence%20Introduction.pptxArtificial%20Intelligence%20Introduction.pptx
Artificial%20Intelligence%20Introduction.pptx
AkhileshPansare
 
csca0101_ch01 (1).pdf
csca0101_ch01 (1).pdfcsca0101_ch01 (1).pdf
csca0101_ch01 (1).pdf
AkhileshPansare
 
Software Specifications with details exp
Software Specifications with details expSoftware Specifications with details exp
Software Specifications with details exp
AkhileshPansare
 
DOC-20230408-WA0002..pptx
DOC-20230408-WA0002..pptxDOC-20230408-WA0002..pptx
DOC-20230408-WA0002..pptx
AkhileshPansare
 
DOC-20230408-WA0002..pptx
DOC-20230408-WA0002..pptxDOC-20230408-WA0002..pptx
DOC-20230408-WA0002..pptx
AkhileshPansare
 
DOC-20230408-WA0002..pptx
DOC-20230408-WA0002..pptxDOC-20230408-WA0002..pptx
DOC-20230408-WA0002..pptx
AkhileshPansare
 
Airbags in automobile.pptx
Airbags in automobile.pptxAirbags in automobile.pptx
Airbags in automobile.pptx
AkhileshPansare
 
EP848-PowerpointFa bearing.pptx
EP848-PowerpointFa bearing.pptxEP848-PowerpointFa bearing.pptx
EP848-PowerpointFa bearing.pptx
AkhileshPansare
 
Force and Motion PowerPoint.pdf
Force and Motion PowerPoint.pdfForce and Motion PowerPoint.pdf
Force and Motion PowerPoint.pdf
AkhileshPansare
 
Artificial%20Intelligence%20Introduction.pptx
Artificial%20Intelligence%20Introduction.pptxArtificial%20Intelligence%20Introduction.pptx
Artificial%20Intelligence%20Introduction.pptx
AkhileshPansare
 

Recently uploaded (20)

STRABAG SE - Investor Presentation - February 2024.pdf
STRABAG SE - Investor Presentation - February 2024.pdfSTRABAG SE - Investor Presentation - February 2024.pdf
STRABAG SE - Investor Presentation - February 2024.pdf
andrianalampka
 
Monterey College of Law’s mission is to z
Monterey College of Law’s mission is to zMonterey College of Law’s mission is to z
Monterey College of Law’s mission is to z
seoali2660
 
Lec 12.pdfghhjjhhjkkkkkkkkkkkjfcvhiiugcvvh
Lec 12.pdfghhjjhhjkkkkkkkkkkkjfcvhiiugcvvhLec 12.pdfghhjjhhjkkkkkkkkkkkjfcvhiiugcvvh
Lec 12.pdfghhjjhhjkkkkkkkkkkkjfcvhiiugcvvh
saifalroby72
 
Splunk_ITSI_Interview_Prep_Deck.pptx interview
Splunk_ITSI_Interview_Prep_Deck.pptx interviewSplunk_ITSI_Interview_Prep_Deck.pptx interview
Splunk_ITSI_Interview_Prep_Deck.pptx interview
willmorekanan
 
apidays New York 2025 - AI for All by Ananya Upadhyay (United Rentals, Inc.)
apidays New York 2025 - AI for All by Ananya Upadhyay (United Rentals, Inc.)apidays New York 2025 - AI for All by Ananya Upadhyay (United Rentals, Inc.)
apidays New York 2025 - AI for All by Ananya Upadhyay (United Rentals, Inc.)
apidays
 
Professional Certificate in Applied AI and Machine Learning
Professional Certificate in Applied AI and Machine LearningProfessional Certificate in Applied AI and Machine Learning
Professional Certificate in Applied AI and Machine Learning
Nafisur Ahmed
 
Understanding LLM Temperature: A comprehensive Guide
Understanding LLM Temperature: A comprehensive GuideUnderstanding LLM Temperature: A comprehensive Guide
Understanding LLM Temperature: A comprehensive Guide
Tamanna36
 
apidays New York 2025 - To tune or not to tune by Anamitra Dutta Majumdar (In...
apidays New York 2025 - To tune or not to tune by Anamitra Dutta Majumdar (In...apidays New York 2025 - To tune or not to tune by Anamitra Dutta Majumdar (In...
apidays New York 2025 - To tune or not to tune by Anamitra Dutta Majumdar (In...
apidays
 
this is the Dr. ibrahim presentations ppt.pptx
this is the Dr. ibrahim presentations ppt.pptxthis is the Dr. ibrahim presentations ppt.pptx
this is the Dr. ibrahim presentations ppt.pptx
ibrahimabdi22
 
TUG BD Kick Off Meet up 21 May Slide Deck.pptx
TUG BD Kick Off Meet up 21 May Slide Deck.pptxTUG BD Kick Off Meet up 21 May Slide Deck.pptx
TUG BD Kick Off Meet up 21 May Slide Deck.pptx
SaidAlHaque
 
Lec 11.pdfgghjuuyffhkiiiiuuiiiiiiuhffghjiu
Lec 11.pdfgghjuuyffhkiiiiuuiiiiiiuhffghjiuLec 11.pdfgghjuuyffhkiiiiuuiiiiiiuhffghjiu
Lec 11.pdfgghjuuyffhkiiiiuuiiiiiiuhffghjiu
saifalroby72
 
DIGITAL MARKETING TRAINING IN KERALA.pdf
DIGITAL MARKETING TRAINING IN KERALA.pdfDIGITAL MARKETING TRAINING IN KERALA.pdf
DIGITAL MARKETING TRAINING IN KERALA.pdf
aacj102006
 
Introduction to information about Data Structure.pptx
Introduction to information about Data Structure.pptxIntroduction to information about Data Structure.pptx
Introduction to information about Data Structure.pptx
tarrebulehora
 
apidays New York 2025 - How AI is Transforming Product Management by Shereen ...
apidays New York 2025 - How AI is Transforming Product Management by Shereen ...apidays New York 2025 - How AI is Transforming Product Management by Shereen ...
apidays New York 2025 - How AI is Transforming Product Management by Shereen ...
apidays
 
DEWDHDIEFHIFHIHGIERHFIHIM SC ID (2).pptx
DEWDHDIEFHIFHIHGIERHFIHIM SC ID (2).pptxDEWDHDIEFHIFHIHGIERHFIHIM SC ID (2).pptx
DEWDHDIEFHIFHIHGIERHFIHIM SC ID (2).pptx
f8jyv28tjr
 
Kilowatt's Impact Report _ 2024 x
Kilowatt's Impact Report _ 2024                xKilowatt's Impact Report _ 2024                x
Kilowatt's Impact Report _ 2024 x
Kilowatt
 
tinywow_Varia_PPT Leadership skills1_80706257.docx
tinywow_Varia_PPT Leadership skills1_80706257.docxtinywow_Varia_PPT Leadership skills1_80706257.docx
tinywow_Varia_PPT Leadership skills1_80706257.docx
abdulrhmansultanfa
 
dinosourrrrrrrrrrrrrrrrrrrrrr formula .pptx
dinosourrrrrrrrrrrrrrrrrrrrrr formula .pptxdinosourrrrrrrrrrrrrrrrrrrrrr formula .pptx
dinosourrrrrrrrrrrrrrrrrrrrrr formula .pptx
ShohidulIslamSovon
 
390713553-Introduction-to-Apportionment-and-Voting.pptx
390713553-Introduction-to-Apportionment-and-Voting.pptx390713553-Introduction-to-Apportionment-and-Voting.pptx
390713553-Introduction-to-Apportionment-and-Voting.pptx
KhimJDAbordo
 
Mathcad Sales Presentation software for use.PPTX
Mathcad Sales Presentation software for use.PPTXMathcad Sales Presentation software for use.PPTX
Mathcad Sales Presentation software for use.PPTX
ManojSharma311544
 
STRABAG SE - Investor Presentation - February 2024.pdf
STRABAG SE - Investor Presentation - February 2024.pdfSTRABAG SE - Investor Presentation - February 2024.pdf
STRABAG SE - Investor Presentation - February 2024.pdf
andrianalampka
 
Monterey College of Law’s mission is to z
Monterey College of Law’s mission is to zMonterey College of Law’s mission is to z
Monterey College of Law’s mission is to z
seoali2660
 
Lec 12.pdfghhjjhhjkkkkkkkkkkkjfcvhiiugcvvh
Lec 12.pdfghhjjhhjkkkkkkkkkkkjfcvhiiugcvvhLec 12.pdfghhjjhhjkkkkkkkkkkkjfcvhiiugcvvh
Lec 12.pdfghhjjhhjkkkkkkkkkkkjfcvhiiugcvvh
saifalroby72
 
Splunk_ITSI_Interview_Prep_Deck.pptx interview
Splunk_ITSI_Interview_Prep_Deck.pptx interviewSplunk_ITSI_Interview_Prep_Deck.pptx interview
Splunk_ITSI_Interview_Prep_Deck.pptx interview
willmorekanan
 
apidays New York 2025 - AI for All by Ananya Upadhyay (United Rentals, Inc.)
apidays New York 2025 - AI for All by Ananya Upadhyay (United Rentals, Inc.)apidays New York 2025 - AI for All by Ananya Upadhyay (United Rentals, Inc.)
apidays New York 2025 - AI for All by Ananya Upadhyay (United Rentals, Inc.)
apidays
 
Professional Certificate in Applied AI and Machine Learning
Professional Certificate in Applied AI and Machine LearningProfessional Certificate in Applied AI and Machine Learning
Professional Certificate in Applied AI and Machine Learning
Nafisur Ahmed
 
Understanding LLM Temperature: A comprehensive Guide
Understanding LLM Temperature: A comprehensive GuideUnderstanding LLM Temperature: A comprehensive Guide
Understanding LLM Temperature: A comprehensive Guide
Tamanna36
 
apidays New York 2025 - To tune or not to tune by Anamitra Dutta Majumdar (In...
apidays New York 2025 - To tune or not to tune by Anamitra Dutta Majumdar (In...apidays New York 2025 - To tune or not to tune by Anamitra Dutta Majumdar (In...
apidays New York 2025 - To tune or not to tune by Anamitra Dutta Majumdar (In...
apidays
 
this is the Dr. ibrahim presentations ppt.pptx
this is the Dr. ibrahim presentations ppt.pptxthis is the Dr. ibrahim presentations ppt.pptx
this is the Dr. ibrahim presentations ppt.pptx
ibrahimabdi22
 
TUG BD Kick Off Meet up 21 May Slide Deck.pptx
TUG BD Kick Off Meet up 21 May Slide Deck.pptxTUG BD Kick Off Meet up 21 May Slide Deck.pptx
TUG BD Kick Off Meet up 21 May Slide Deck.pptx
SaidAlHaque
 
Lec 11.pdfgghjuuyffhkiiiiuuiiiiiiuhffghjiu
Lec 11.pdfgghjuuyffhkiiiiuuiiiiiiuhffghjiuLec 11.pdfgghjuuyffhkiiiiuuiiiiiiuhffghjiu
Lec 11.pdfgghjuuyffhkiiiiuuiiiiiiuhffghjiu
saifalroby72
 
DIGITAL MARKETING TRAINING IN KERALA.pdf
DIGITAL MARKETING TRAINING IN KERALA.pdfDIGITAL MARKETING TRAINING IN KERALA.pdf
DIGITAL MARKETING TRAINING IN KERALA.pdf
aacj102006
 
Introduction to information about Data Structure.pptx
Introduction to information about Data Structure.pptxIntroduction to information about Data Structure.pptx
Introduction to information about Data Structure.pptx
tarrebulehora
 
apidays New York 2025 - How AI is Transforming Product Management by Shereen ...
apidays New York 2025 - How AI is Transforming Product Management by Shereen ...apidays New York 2025 - How AI is Transforming Product Management by Shereen ...
apidays New York 2025 - How AI is Transforming Product Management by Shereen ...
apidays
 
DEWDHDIEFHIFHIHGIERHFIHIM SC ID (2).pptx
DEWDHDIEFHIFHIHGIERHFIHIM SC ID (2).pptxDEWDHDIEFHIFHIHGIERHFIHIM SC ID (2).pptx
DEWDHDIEFHIFHIHGIERHFIHIM SC ID (2).pptx
f8jyv28tjr
 
Kilowatt's Impact Report _ 2024 x
Kilowatt's Impact Report _ 2024                xKilowatt's Impact Report _ 2024                x
Kilowatt's Impact Report _ 2024 x
Kilowatt
 
tinywow_Varia_PPT Leadership skills1_80706257.docx
tinywow_Varia_PPT Leadership skills1_80706257.docxtinywow_Varia_PPT Leadership skills1_80706257.docx
tinywow_Varia_PPT Leadership skills1_80706257.docx
abdulrhmansultanfa
 
dinosourrrrrrrrrrrrrrrrrrrrrr formula .pptx
dinosourrrrrrrrrrrrrrrrrrrrrr formula .pptxdinosourrrrrrrrrrrrrrrrrrrrrr formula .pptx
dinosourrrrrrrrrrrrrrrrrrrrrr formula .pptx
ShohidulIslamSovon
 
390713553-Introduction-to-Apportionment-and-Voting.pptx
390713553-Introduction-to-Apportionment-and-Voting.pptx390713553-Introduction-to-Apportionment-and-Voting.pptx
390713553-Introduction-to-Apportionment-and-Voting.pptx
KhimJDAbordo
 
Mathcad Sales Presentation software for use.PPTX
Mathcad Sales Presentation software for use.PPTXMathcad Sales Presentation software for use.PPTX
Mathcad Sales Presentation software for use.PPTX
ManojSharma311544
 

PHP.pptx is the Best Explanation of ppts

  • 2. Introduction Of PHP  PHP is a recursive acronym for "PHP: Hypertext Preprocessor“ or “Personal Home Page”.  PHP is a server side scripting language that is embedded in HTML. It is used to manage dynamic content, databases, session tracking, even build entire e- commerce sites.  It is integrated with a number of popular databases, including MySQL, PostgreSQL, Oracle, blockchain, and Microsoft SQL Server.
  • 3. Common use Of PHP  PHP performs system functions, i.e. from files on a system it can create, open, read, write, and close them.  PHP can handle forms, i.e. gather data from files, save data to a file, through email you can send data, return data to the user.  You add, delete, modify elements within your database through PHP.  Using PHP, you can restrict users to access some pages of your website.  It can encrypt data.
  • 4. Feature And Advantages of PHP  Simple  Interpreted  Faster  Open Source  Platform Independent  Efficiency  Flexibility
  • 5. What Can PHP Do?  PHP can generate dynamic page content  PHP can create, open, read, write, delete, and close files on the server  PHP can collect form data  PHP can send and receive cookies  PHP can add, delete, modify data in your database  PHP can be used to control user-access  PHP can encrypt data
  • 6. Why PHP?  PHP runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)  PHP is compatible with almost all servers used today (Apache)  PHP supports a wide range of databases  PHP is free PHP is easy to learn and runs efficiently on the server side
  • 7. PHP Syntax  A PHP Script is always executed at server side ,and browser gets the plain HTML result in response.  The Location of PHP Script can be anywhere in document in the document.  The PHP Parsing engine requires a method to distinguish PHP code from other script in the page. This is called escaping to PHP.  The PHP Script start with <?php and ends with ?>
  • 9. Extension Of PHP  . Php is the extension for PHP Files.  A PHP is Combination of PHP script with HTML Tags.
  • 10. Simple Program to display Hello Message in PHP  <?php echo "<h2>PHP is Fun!</h2>"; echo "Hello world!<br>"; echo "I'm about to learn PHP!<br>"; echo "This ", "string ", "was ", "made ", "with multiple parameters."; ?> The echo statement can be used with or without parentheses: echo or echo().
  • 11. PHP Comments <?php // This is a single-line comment # This is also a single-line comment /* This is a multiple-lines comment block that spans over multiple lines */ // You can also use comments to leave out parts of a code line $x = 5 /* + 15 */ + 5; echo $x; ?>
  • 12. Variables in PHP  Definition: A Variable is the Name Given to memory Location where we can store some Value . The Value depends upon the data type of the variable.  Declaration: In PHP we declare Variables by using “$ “ symbol without assigning the data type. The Data type of variable is decided by the PHP parsing engine when value is assigned to it.
  • 13. Example of Variable Declaration <?php $txt = "Hello world!"; $x = 5; $y = 10.5; echo $txt; echo "<br>"; echo $x; echo "<br>"; echo $y; ?>
  • 14. Addition Of two Numbers <?php $no1=12; $no2=19; $sum=$no1+$no2; echo"Summation is:-".$sum; ?>
  • 15. Conditions and Loops Control Structure If If else While Do While Else If ladder Switch case For For each
  • 16. Function  The Concept Of Programing is Same of any other Programming Language.  Definition: A function is a block of statements related to such a task which we want to execute repeatedly in our program.  A function can take arguments and also can return value.  Up till now we have seen the function echo().  This is built in function of php.  Now We will create our own user defined function.  Related to functions there are two important points:  1Creating a PHP Function.  2. Calling a PHP Function
  • 17. Function Syntax function function_name (parameters) { Statements; }
  • 18. Sample Program of function <?php function printmsg() { echo "hello welcome"; } printmsg(); ?>
  • 19. Passing Arguments Through Function <?php function summation($n1,$n2) { $n3=$n1+$n2; echo "Summation is:-".$n3; } summation(10,20); ?>
  • 20. Passing Argument by Reference <?php function summation(&$num) { $num += 5; } $num=10; echo "$num<br>"; summation($num); echo "$num“; ?>
  • 21. Form Handling  When you login into a website or into your mail box, you are interacting with a form.  Forms are used to get input from the user and submit it to the web server for processing.  A form is an HTML tag that contains graphical user interface items such as input box, check boxes radio buttons etc.  The diagram below illustrates the form handling process.