SlideShare a Scribd company logo
PHP Tutorial
• PHP is a scripting language that has the ability to output HTML.
Instead of manually writing HTML files, you can program PHP to
automatically generate them for you.
• Did you know that every page you see on this website is generated
from a single PHP script? This means that when a new page is added,
there’s no need to manually create an HTML file. The PHP script
generates it.
PHP and HTML
• PHP scripts are embedded inside HTML files. The start of a PHP script is indicated by <?php and the end is
indicated by ?>. When a script is run, it’s replaced in the HTML by its output. For example, the following PHP
script outputs the text ‘Hello’:
• <b><?php echo 'Hello'; ?></b>
• The above PHP script will be replaced by its output. So the resulting HTML is this:
• <b>Hello</b>
• There can be an unlimited number of PHP scripts in an HTML file, and they can be placed anywhere inside
the file.
• However, HTML files that contain PHP use the file extension .php, rather than the usual .html. This is so that
the PHP interpreters on web servers know that the file contains PHP code to be executed.
PHP Include
• One of the useful features of PHP is its ability to include files inside other
files.
• Many websites use the same header on every page of their site. With PHP,
they can write their header in a separate HTML file called header.html, and
have PHP ‘include’ the contents of this file on every other page. They do
this by writing the following code where they want the header to go:
• <?php include('header.html'); ?>
• This way, when they want to edit their header, they only need to edit their
header.html file once and the changes are made on every page.
Learn More PHP
• PHP is a very powerful language with many capabilities, most of
which are beyond the scope of this tutorial. But luckily for you, there
is more extensive PHP training available if you want to go further with
PHP.
• You can get online PHP training from providers like Treehouse. PHP is
also covered by some good books such as PHP and MySQL for
Dynamic Websites, and PHP and MySQL Web Development.

More Related Content

What's hot (16)

ODP
Php
Home
 
PPT
Introduction to PHP Basics
TheCreativedev Blog
 
PPT
Php
babiaberra
 
PPTX
PHP .ppt
dinesh rana
 
PPTX
.Net Development Services VS | PHP Development Services
Worth Studios Pvt. Ltd.
 
PPSX
Advanced PHP Web Development Tools in 2015
iScripts
 
PPTX
Jaggery Introductory Webinar
Nuwan Bandara
 
PPT
Presentation1
Twigsta
 
PPTX
HTML BASIC TAGs
Poushali Inamdar
 
PDF
Php workshop L01 CSS
Mohammad Tahsin Alshalabi
 
PPT
Lesson 2: Getting To Know HTML
Olivia Moran
 
PPTX
Journey To The Front End World - Part3 - The Machine
Irfan Maulana
 
PDF
WWX 2013 Cocktail
Raphael Harmel
 
PPTX
LecWeek2 lecture-whatiswebdesign-part2
Katherine McCurdy-Lapierre, R.G.D.
 
PDF
php_tizag_tutorial
tutorialsruby
 
PPTX
HTML5 tutorials for beginners - Imrokraft
imrokraft
 
Php
Home
 
Introduction to PHP Basics
TheCreativedev Blog
 
PHP .ppt
dinesh rana
 
.Net Development Services VS | PHP Development Services
Worth Studios Pvt. Ltd.
 
Advanced PHP Web Development Tools in 2015
iScripts
 
Jaggery Introductory Webinar
Nuwan Bandara
 
Presentation1
Twigsta
 
HTML BASIC TAGs
Poushali Inamdar
 
Php workshop L01 CSS
Mohammad Tahsin Alshalabi
 
Lesson 2: Getting To Know HTML
Olivia Moran
 
Journey To The Front End World - Part3 - The Machine
Irfan Maulana
 
WWX 2013 Cocktail
Raphael Harmel
 
LecWeek2 lecture-whatiswebdesign-part2
Katherine McCurdy-Lapierre, R.G.D.
 
php_tizag_tutorial
tutorialsruby
 
HTML5 tutorials for beginners - Imrokraft
imrokraft
 

Viewers also liked (14)

PDF
Pemrograman Web with PHP MySQL
djokotingkir999
 
PPT
SQL -PHP Tutorial
Information Technology
 
PDF
Modul praktikum javascript
hardyta
 
PPTX
PHP tutorial | ptutorial
PTutorial Web
 
DOC
Php mysq l - siapa - takut
SMK Negeri 6 Malang
 
PDF
Pemrograman web dengan php my sql
anarkonam
 
PDF
PHP MySQL database connections
ayman diab
 
PDF
Perl programming language
Elie Obeid
 
PDF
Php tutorial(w3schools)
Arjun Shanka
 
PDF
Ebook PHP - menyelam dan menaklukan samudra php
Puguh Nugroho
 
PPT
Beginners PHP Tutorial
alexjones89
 
ODP
PHP Web Programming
Muthuselvam RS
 
PDF
Introduction to PHP
Bradley Holt
 
PPT
Php Presentation
Manish Bothra
 
Pemrograman Web with PHP MySQL
djokotingkir999
 
SQL -PHP Tutorial
Information Technology
 
Modul praktikum javascript
hardyta
 
PHP tutorial | ptutorial
PTutorial Web
 
Php mysq l - siapa - takut
SMK Negeri 6 Malang
 
Pemrograman web dengan php my sql
anarkonam
 
PHP MySQL database connections
ayman diab
 
Perl programming language
Elie Obeid
 
Php tutorial(w3schools)
Arjun Shanka
 
Ebook PHP - menyelam dan menaklukan samudra php
Puguh Nugroho
 
Beginners PHP Tutorial
alexjones89
 
PHP Web Programming
Muthuselvam RS
 
Introduction to PHP
Bradley Holt
 
Php Presentation
Manish Bothra
 
Ad

Similar to Php tutorial (20)

PPTX
Introduction to PHP from Beginning to End
christopherneo4
 
PPTX
Introduction to PHP and mysql BSIT SSC project
ChristopherYSabado
 
DOCX
PHP.docx
NithiyaNithi2
 
PDF
Php notes 01
Aakaash Ngl
 
PDF
Php tutorial2
Marko Ancev
 
PDF
Php tutorial
Niit
 
PDF
php_tizag_tutorial
tutorialsruby
 
PDF
PHP learning
Self-Employed
 
PDF
Php tizag tutorial
PrinceGuru MS
 
PDF
Php tizag tutorial
Pradeep Kumar
 
PDF
Php tizag tutorial
jaggu536
 
PPTX
lec1 (1).pptxkeoiwjwoijeoiwjeoijwoeijewoi
PedakotaPavankumar
 
PDF
Php tutorial
sushil kumar
 
PDF
Php tutorial
vigneswaran54
 
PDF
Php tutorial
Nguyễn Hoà
 
PPTX
Php intro
sana mateen
 
PPT
Php unit i
prakashvs7
 
PPTX
Introduction to PHP.pptx
SherinRappai
 
PPTX
Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...
anshkhurana01
 
PPTX
INTRODUCTION to php.pptx
priyanshupanchal8
 
Introduction to PHP from Beginning to End
christopherneo4
 
Introduction to PHP and mysql BSIT SSC project
ChristopherYSabado
 
PHP.docx
NithiyaNithi2
 
Php notes 01
Aakaash Ngl
 
Php tutorial2
Marko Ancev
 
Php tutorial
Niit
 
php_tizag_tutorial
tutorialsruby
 
PHP learning
Self-Employed
 
Php tizag tutorial
PrinceGuru MS
 
Php tizag tutorial
Pradeep Kumar
 
Php tizag tutorial
jaggu536
 
lec1 (1).pptxkeoiwjwoijeoiwjeoijwoeijewoi
PedakotaPavankumar
 
Php tutorial
sushil kumar
 
Php tutorial
vigneswaran54
 
Php tutorial
Nguyễn Hoà
 
Php intro
sana mateen
 
Php unit i
prakashvs7
 
Introduction to PHP.pptx
SherinRappai
 
Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...
anshkhurana01
 
INTRODUCTION to php.pptx
priyanshupanchal8
 
Ad

More from Son Nguyen (20)

PPTX
Your new maven friend – the mule maven
Son Nguyen
 
PPTX
Soa governance for the modern business
Son Nguyen
 
PPTX
Quality sdk for your apis in minutes!
Son Nguyen
 
PPTX
Maven tools & archetypes
Son Nguyen
 
PPTX
Let api change your relationship with your doctor
Son Nguyen
 
PPTX
Increase revenue and reinvigorate your business with api
Son Nguyen
 
PPTX
How to – wrap soap web service around a database
Son Nguyen
 
PPTX
How to – rest api proxy to soap webservice
Son Nguyen
 
PPTX
Anypoint runtime manager v1
Son Nguyen
 
PPTX
A good api strategy can help turn your
Son Nguyen
 
PPTX
10 steps to design and build the perfect
Son Nguyen
 
PPTX
What is the difference between using private flow
Son Nguyen
 
PPTX
Troubleshooting mule
Son Nguyen
 
PPTX
Running mule as worker role on azure
Son Nguyen
 
PPTX
Real time data processing with anypoint connector for kafka
Son Nguyen
 
PPTX
Performance tuning in mule
Son Nguyen
 
PPTX
Mule intelli j tips
Son Nguyen
 
PPTX
Introducing the anypoint connector for redis
Son Nguyen
 
PPTX
How to – data integrity checks in batch processing
Son Nguyen
 
PPTX
How soa paved the way for cloud
Son Nguyen
 
Your new maven friend – the mule maven
Son Nguyen
 
Soa governance for the modern business
Son Nguyen
 
Quality sdk for your apis in minutes!
Son Nguyen
 
Maven tools & archetypes
Son Nguyen
 
Let api change your relationship with your doctor
Son Nguyen
 
Increase revenue and reinvigorate your business with api
Son Nguyen
 
How to – wrap soap web service around a database
Son Nguyen
 
How to – rest api proxy to soap webservice
Son Nguyen
 
Anypoint runtime manager v1
Son Nguyen
 
A good api strategy can help turn your
Son Nguyen
 
10 steps to design and build the perfect
Son Nguyen
 
What is the difference between using private flow
Son Nguyen
 
Troubleshooting mule
Son Nguyen
 
Running mule as worker role on azure
Son Nguyen
 
Real time data processing with anypoint connector for kafka
Son Nguyen
 
Performance tuning in mule
Son Nguyen
 
Mule intelli j tips
Son Nguyen
 
Introducing the anypoint connector for redis
Son Nguyen
 
How to – data integrity checks in batch processing
Son Nguyen
 
How soa paved the way for cloud
Son Nguyen
 

Recently uploaded (20)

PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 

Php tutorial

  • 2. • PHP is a scripting language that has the ability to output HTML. Instead of manually writing HTML files, you can program PHP to automatically generate them for you. • Did you know that every page you see on this website is generated from a single PHP script? This means that when a new page is added, there’s no need to manually create an HTML file. The PHP script generates it.
  • 3. PHP and HTML • PHP scripts are embedded inside HTML files. The start of a PHP script is indicated by <?php and the end is indicated by ?>. When a script is run, it’s replaced in the HTML by its output. For example, the following PHP script outputs the text ‘Hello’: • <b><?php echo 'Hello'; ?></b> • The above PHP script will be replaced by its output. So the resulting HTML is this: • <b>Hello</b> • There can be an unlimited number of PHP scripts in an HTML file, and they can be placed anywhere inside the file. • However, HTML files that contain PHP use the file extension .php, rather than the usual .html. This is so that the PHP interpreters on web servers know that the file contains PHP code to be executed.
  • 4. PHP Include • One of the useful features of PHP is its ability to include files inside other files. • Many websites use the same header on every page of their site. With PHP, they can write their header in a separate HTML file called header.html, and have PHP ‘include’ the contents of this file on every other page. They do this by writing the following code where they want the header to go: • <?php include('header.html'); ?> • This way, when they want to edit their header, they only need to edit their header.html file once and the changes are made on every page.
  • 5. Learn More PHP • PHP is a very powerful language with many capabilities, most of which are beyond the scope of this tutorial. But luckily for you, there is more extensive PHP training available if you want to go further with PHP. • You can get online PHP training from providers like Treehouse. PHP is also covered by some good books such as PHP and MySQL for Dynamic Websites, and PHP and MySQL Web Development.