SlideShare a Scribd company logo
Introduction of PHP
By Umar Farooque Khan
http://www.ptutorial.com
PHP tutorial | ptutorial
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
Steve Fort
 
Php mysql
Php mysqlPhp mysql
Php mysql
Shehrevar Davierwala
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
MAGNA COLLEGE OF ENGINEERING
 
Php introduction
Php introductionPhp introduction
Php introduction
krishnapriya Tadepalli
 
Php
PhpPhp
Php
vivlinux
 
Chapter 02 php basic syntax
Chapter 02   php basic syntaxChapter 02   php basic syntax
Chapter 02 php basic syntax
Dhani Ahmad
 
PHP NOTES FOR BEGGINERS
PHP NOTES FOR BEGGINERSPHP NOTES FOR BEGGINERS
PHP NOTES FOR BEGGINERS
Aminiel Michael
 
Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
pratik tambekar
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
Jussi Pohjolainen
 
PHP
PHPPHP
PHP
sometech
 
Php
PhpPhp
Php
Shyam Khant
 
PHP complete reference with database concepts for beginners
PHP complete reference with database concepts for beginnersPHP complete reference with database concepts for beginners
PHP complete reference with database concepts for beginners
Mohammed Mushtaq Ahmed
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
Nidhi mishra
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
Meetendra Singh
 
Php basics
Php basicsPhp basics
Php basics
Jamshid Hashimi
 
Control Structures In Php 2
Control Structures In Php 2Control Structures In Php 2
Control Structures In Php 2
Digital Insights - Digital Marketing Agency
 
PHP Loops and PHP Forms
PHP  Loops and PHP FormsPHP  Loops and PHP Forms
PHP Loops and PHP Forms
M.Zalmai Rahmani
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
Anjan Banda
 
Basics PHP
Basics PHPBasics PHP
Basics PHP
Alokin Software Pvt Ltd
 
Php mysql
Php mysqlPhp mysql
Php mysql
Abu Bakar
 

Viewers also liked (15)

Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
Dr. Ramkumar Lakshminarayanan
 
Pemrograman Web with PHP MySQL
Pemrograman Web with PHP MySQLPemrograman Web with PHP MySQL
Pemrograman Web with PHP MySQL
djokotingkir999
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
Son Nguyen
 
SQL -PHP Tutorial
SQL -PHP TutorialSQL -PHP Tutorial
SQL -PHP Tutorial
Information Technology
 
PHP7 - For Its Best Performance
PHP7 - For Its Best PerformancePHP7 - For Its Best Performance
PHP7 - For Its Best Performance
Xinchen 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 & Performance
Xinchen 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 train
Xinchen Hui
 
Modul praktikum javascript
Modul praktikum javascriptModul praktikum javascript
Modul praktikum javascript
hardyta
 
Perl programming language
Perl programming languagePerl programming language
Perl programming language
Elie Obeid
 
PHP 7
PHP 7PHP 7
PHP 7
Guilherme Blanco
 
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
Colin O'Dell
 
Last train to php 7
Last train to php 7Last train to php 7
Last train to php 7
Damien Seguy
 
Php Presentation
Php PresentationPhp Presentation
Php Presentation
Manish Bothra
 
Php mysql ppt
Php mysql pptPhp mysql ppt
Php mysql ppt
Karmatechnologies Pvt. Ltd.
 
Pemrograman Web with PHP MySQL
Pemrograman Web with PHP MySQLPemrograman Web with PHP MySQL
Pemrograman Web with PHP MySQL
djokotingkir999
 
PHP7 - For Its Best Performance
PHP7 - For Its Best PerformancePHP7 - For Its Best Performance
PHP7 - For Its Best Performance
Xinchen 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 & Performance
Xinchen 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 train
Xinchen Hui
 
Modul praktikum javascript
Modul praktikum javascriptModul praktikum javascript
Modul praktikum javascript
hardyta
 
Perl programming language
Perl programming languagePerl programming language
Perl programming language
Elie 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] 2015
Colin O'Dell
 
Last train to php 7
Last train to php 7Last train to php 7
Last train to php 7
Damien Seguy
 
Ad

Similar to PHP tutorial | ptutorial (20)

Php unit i
Php unit iPhp unit i
Php unit i
BagavathiLakshmi
 
Php
PhpPhp
Php
Vineet Vats
 
PHP - Introduction to PHP Fundamentals
PHP -  Introduction to PHP FundamentalsPHP -  Introduction to PHP Fundamentals
PHP - Introduction to PHP Fundamentals
Vibrant Technologies & Computers
 
Php1
Php1Php1
Php1
rajikaa
 
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 tutorialw3schools
Php tutorialw3schoolsPhp tutorialw3schools
Php tutorialw3schools
rasool noorpour
 
PHP.docx
PHP.docxPHP.docx
PHP.docx
NithiyaNithi2
 
Php1
Php1Php1
Php1
poornima sugumaran
 
Materi Dasar PHP
Materi Dasar PHPMateri Dasar PHP
Materi Dasar PHP
Robby Firmansyah
 
Php1
Php1Php1
Php1
poornima sugumaran
 
Php1
Php1Php1
Php1
poornima sugumaran
 
1. introduction to php and variable
1. introduction to php and variable1. introduction to php and variable
1. introduction to php and variable
NurAliaAqilaMuhalis
 
Php tizag tutorial
Php tizag tutorial Php tizag tutorial
Php tizag tutorial
jaggu536
 
php_tizag_tutorial
php_tizag_tutorialphp_tizag_tutorial
php_tizag_tutorial
tutorialsruby
 
php_tizag_tutorial
php_tizag_tutorialphp_tizag_tutorial
php_tizag_tutorial
tutorialsruby
 
PHP learning
PHP learningPHP learning
PHP learning
Self-Employed
 
Php tizag tutorial
Php tizag tutorialPhp tizag tutorial
Php tizag tutorial
Pradeep Kumar
 
Php tizag tutorial
Php tizag tutorialPhp tizag tutorial
Php tizag tutorial
PrinceGuru MS
 
Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
SHARANBAJWA
 
Introduction to-php
Introduction to-phpIntroduction to-php
Introduction to-php
AhmedAElHalimAhmed
 
Ad

Recently uploaded (20)

Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Impelsys Inc.
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry ReportThe State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdfBoosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Alkin Tezuysal
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training RoadblocksDown the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
Secure Access with Azure Active Directory
Secure Access with Azure Active DirectorySecure Access with Azure Active Directory
Secure Access with Azure Active Directory
VICTOR MAESTRE RAMIREZ
 
Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.
hok12341073
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdfArtificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOMEstablish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Anchore
 
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Infrassist Technologies Pvt. Ltd.
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization ProgramOracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Anish Kumar
 
Ben Blair - Operating Safely in a Vibe Coding World
Ben Blair - Operating Safely in a Vibe Coding WorldBen Blair - Operating Safely in a Vibe Coding World
Ben Blair - Operating Safely in a Vibe Coding World
AWS Chicago
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementaryMurdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too LateKubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdfvertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
Edge AI and Vision Alliance
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME FlowProviding an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Impelsys Inc.
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry ReportThe State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdfBoosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Alkin Tezuysal
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training RoadblocksDown the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
Secure Access with Azure Active Directory
Secure Access with Azure Active DirectorySecure Access with Azure Active Directory
Secure Access with Azure Active Directory
VICTOR MAESTRE RAMIREZ
 
Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.
hok12341073
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdfArtificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOMEstablish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Anchore
 
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Infrassist Technologies Pvt. Ltd.
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization ProgramOracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Anish Kumar
 
Ben Blair - Operating Safely in a Vibe Coding World
Ben Blair - Operating Safely in a Vibe Coding WorldBen Blair - Operating Safely in a Vibe Coding World
Ben Blair - Operating Safely in a Vibe Coding World
AWS Chicago
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementaryMurdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too LateKubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdfvertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
Edge AI and Vision Alliance
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME FlowProviding an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 

PHP tutorial | ptutorial

  • 1. Introduction of PHP By Umar Farooque Khan http://www.ptutorial.com
  • 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