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 and mysql BSIT SSC project
ChristopherYSabado
 
PPTX
Introduction to PHP from Beginning to End
christopherneo4
 
PDF
Php tizag tutorial
jaggu536
 
PDF
php_tizag_tutorial
tutorialsruby
 
PDF
PHP learning
Self-Employed
 
PDF
Php tizag tutorial
Pradeep Kumar
 
PDF
Php tizag tutorial
PrinceGuru MS
 
PPTX
lec1 (1).pptxkeoiwjwoijeoiwjeoijwoeijewoi
PedakotaPavankumar
 
PPT
introduction to php notes for engineering students.ppt
manju451965
 
PPTX
Php intro
sana mateen
 
PPT
Php unit i
prakashvs7
 
PPTX
Welcome to computer programmer 2
MLG College of Learning, Inc
 
DOCX
PHP.docx
NithiyaNithi2
 
PPTX
Introduction to PHP.pptx
MarianJRuben
 
PPTX
Introduction to PHP.pptx
SANGEETHA Deepan Bharathi
 
PPTX
Web Application Development using PHP Chapter 1
Mohd Harris Ahmad Jaal
 
PDF
Php tutorial
Niit
 
DOCX
PHP Lesson
Rithirun Meas
 
PPTX
Introduction to PHP.pptx
SherinRappai
 
PPTX
Php unit i
BagavathiLakshmi
 
Introduction to PHP and mysql BSIT SSC project
ChristopherYSabado
 
Introduction to PHP from Beginning to End
christopherneo4
 
Php tizag tutorial
jaggu536
 
php_tizag_tutorial
tutorialsruby
 
PHP learning
Self-Employed
 
Php tizag tutorial
Pradeep Kumar
 
Php tizag tutorial
PrinceGuru MS
 
lec1 (1).pptxkeoiwjwoijeoiwjeoijwoeijewoi
PedakotaPavankumar
 
introduction to php notes for engineering students.ppt
manju451965
 
Php intro
sana mateen
 
Php unit i
prakashvs7
 
Welcome to computer programmer 2
MLG College of Learning, Inc
 
PHP.docx
NithiyaNithi2
 
Introduction to PHP.pptx
MarianJRuben
 
Introduction to PHP.pptx
SANGEETHA Deepan Bharathi
 
Web Application Development using PHP Chapter 1
Mohd Harris Ahmad Jaal
 
Php tutorial
Niit
 
PHP Lesson
Rithirun Meas
 
Introduction to PHP.pptx
SherinRappai
 
Php unit i
BagavathiLakshmi
 
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
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 

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.