SlideShare a Scribd company logo
BY ANCY RAJU
Venture software technologies
 PHP is an acronym for "PHP Hypertext
Preprocessor"
 PHP is a widely-used, open source
scripting language
 PHP scripts are executed on the server
 PHP costs nothing, it is free to download
and use
 PHP files can contain text, HTML, CSS,
JavaScript, and PHP code
 PHP code are executed on the server, and
the result is returned to the browser as plain
HTML
 PHP files have extension ".php"
 PHP can generate dynamic page content
 PHP can create, open, read, write, 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 restrict users to access some
pages on your website
 PHP can encrypt data
 With PHP you are not limited to output
HTML.
 We can output images, PDF files, and even
Flash movies.
 We can also output any text, such as
XHTML and XML.
 PHP runs on various platforms (Windows,
Linux, Unix, Mac OS X, etc.)
 PHP is compatible with almost all servers
used today (Apache, IIS, etc.)
 PHP supports a wide range of databases
 PHP is free. Download it from the official
PHP resource: www.php.net
 PHP is easy to learn and runs efficiently on
the server side
You must:
 install a web server
 install PHP
 install a database, such as MySQL
<?php
PHP code goes here
?>
PROGRAM
<?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.";
?>
OUTPUT
PHP is fun!
Hello world!
I'm about to learn PHP!
This string was made with multiple parameters.
 A comment in PHP code is a line that is not
read/executed as part of the program.
 Its only purpose is to be read by someone
who is editing the code!
 PHP supports three ways of commenting:
<!DOCTYPE html>
<html>
<body>
<?php
// This is a single line comment
# This is also a single line comment
/* This is a multiple lines comment block that spans
over more than one line */
?>
</body>
</html>
EXAMPLE
 String
 Integer
 Floating point numbers
 Boolean
 Array
 Object
 NULL
 A string is a sequence of characters, like "Hello
world!".
 A string can be any text inside quotes.
 We can use single or double quotes:
EXAMPLE
<?php $x = "Hello world!";
echo $x;
echo "<br>";
?>
An integer is a number without decimals.
 Rules for integers:
 An integer must have at least one digit (0-9)
 An integer cannot contain comma or blanks
 An integer must not have a decimal point
 An integer can be either positive or negative
 Integers can be specified in three formats: decimal
(10-based), hexadecimal (16-based - prefixed with
0x) or octal (8-based - prefixed with 0)
EXAMPLE
<?php
$x = 5985;
var_dump($x);
echo "<br>";
$x = -345; // negative number var_dump($x);
echo "<br>";
$x = 0x8C; // hexadecimal number var_dump($x);
echo "<br>";
$x = 047; // octal number
var_dump($x);
?>
 A floating point number is a number with a
Decimal point or a number in exponential form.
In the following example ,the PHP var_dump() function
returns the data type and value of variables:
EXAMPLE
<?php
$x = 10.56765;
var_dump($x);
echo "<br>";
$x = 2.4e3;
var_dump($x);
echo "<br>";
$x = 8E-5;
var_dump($x);
?>
 Booleans can be either TRUE or FALSE.
 $x=true; $y=false;
 Booleans are often used in conditional testing.
 An array stores multiple values in one single
variable.
<?php
$a=array(“a",“b",“c");
var_dump($a);
?>
 An object is a data type which stores data and
information on how to process that data.
 In PHP, an object must be explicitly declared. First
we must declare a class of object.
 For this, we use the class keyword.
 A class is a structure that can contain properties
and methods.
EXAMPLE
<?php
class Car
{
var $color;
function Car($color="green")
{
$this->color = $color;
}
function what_color()
{
return $this->color;
}
}
?>
 The special NULL value represents that a variable
has no value. NULL is the only possible value of
data type NULL.
 The NULL value identifies whether a variable is
empty or not. Also useful to differentiate between
the empty string and null values of databases.
EXAMPLE
<?php
$x="Hello world!";
$x=null;
var_dump($x);
?>
Thank u

More Related Content

PDF
Introduction to PHP
PDF
basic concept of php(Gunikhan sonowal)
PPT
Php, mysq lpart1
PPTX
Php Unit 1
PDF
Php, mysq lpart4(processing html form)
PPT
Control Structures In Php 2
PPTX
Phphacku iitd
PPTX
Loops PHP 04
Introduction to PHP
basic concept of php(Gunikhan sonowal)
Php, mysq lpart1
Php Unit 1
Php, mysq lpart4(processing html form)
Control Structures In Php 2
Phphacku iitd
Loops PHP 04

What's hot (20)

PPTX
PHP for hacks
PPSX
PPT
Php mysql
PPTX
Php by shivitomer
KEY
Using PHP
ODP
Sourcerer and Joomla! rev. 20130903
PPT
Chapter 02 php basic syntax
PDF
Php tutorial
PPT
Php Lecture Notes
PPTX
Introduction to php
PPT
PHP Tutorials
PPT
Php(report)
PDF
Php tutorial(w3schools)
DOC
Php tutorial
PPTX
PHP Variables and scopes
PDF
PHP Loops and PHP Forms
PPT
PHP complete reference with database concepts for beginners
PPT
What Is Php
 
PPT
Introduction to php
PPT
PHP for hacks
Php mysql
Php by shivitomer
Using PHP
Sourcerer and Joomla! rev. 20130903
Chapter 02 php basic syntax
Php tutorial
Php Lecture Notes
Introduction to php
PHP Tutorials
Php(report)
Php tutorial(w3schools)
Php tutorial
PHP Variables and scopes
PHP Loops and PHP Forms
PHP complete reference with database concepts for beginners
What Is Php
 
Introduction to php
Ad

Viewers also liked (16)

PPT
Crazy road signs
PPT
Judith López Ant.anip course final project
DOC
Cornilsen.Resume
PPTX
Topological spintronics
PPTX
Mobile Moments 2016 - Martin McKenna | iZettle
PDF
Cassandra - lesson learned
DOCX
Robert Miller CV uptodate
PDF
Resuscitating Your Omni-Channel Though Mobile
PDF
Mobile And The Media 5 Ways To Succeed In 2016
PDF
Mobile Moments NYC 2016
PDF
Banking On Mobile - Getting Ready for 2016
PPTX
Evaluation question 3
PDF
Mobile, Fintech, and Banking Phase II
PPT
HEAD MOTION CONTROLLED BY WHEELCHAIR
PPTX
Citizenship stage 2 rey, ryan, nishad
Crazy road signs
Judith López Ant.anip course final project
Cornilsen.Resume
Topological spintronics
Mobile Moments 2016 - Martin McKenna | iZettle
Cassandra - lesson learned
Robert Miller CV uptodate
Resuscitating Your Omni-Channel Though Mobile
Mobile And The Media 5 Ways To Succeed In 2016
Mobile Moments NYC 2016
Banking On Mobile - Getting Ready for 2016
Evaluation question 3
Mobile, Fintech, and Banking Phase II
HEAD MOTION CONTROLLED BY WHEELCHAIR
Citizenship stage 2 rey, ryan, nishad
Ad

Similar to Php (20)

PPT
PPTX
INTRODUCTION ON PHP - SERVER SIDE SCRIPTING LANGUAGE
PPTX
Unit 5-PHP Declaring variables, data types, array, string, operators, Expres...
PDF
UNIT4.pdf php basic programming for begginers
PPTX
PHP Course (Basic to Advance)
PPT
php 1
PPTX
introduction to php and its uses in daily
PPTX
The basics of php for engeneering students
PDF
Introduction of PHP.pdf
PPTX
Introduction to PHP.pptx
PDF
WT_PHP_PART1.pdf
PPTX
Ch1(introduction to php)
PPTX
Php.ppt
PPTX
Web Application Development using PHP Chapter 1
PDF
Introduction to php
PPTX
PHP Training Part1
PDF
PHP in Web development and Applications.pdf
PPTX
Php unit i
PDF
PHP Unit-1 Introduction to PHP
INTRODUCTION ON PHP - SERVER SIDE SCRIPTING LANGUAGE
Unit 5-PHP Declaring variables, data types, array, string, operators, Expres...
UNIT4.pdf php basic programming for begginers
PHP Course (Basic to Advance)
php 1
introduction to php and its uses in daily
The basics of php for engeneering students
Introduction of PHP.pdf
Introduction to PHP.pptx
WT_PHP_PART1.pdf
Ch1(introduction to php)
Php.ppt
Web Application Development using PHP Chapter 1
Introduction to php
PHP Training Part1
PHP in Web development and Applications.pdf
Php unit i
PHP Unit-1 Introduction to PHP

Recently uploaded (20)

PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
Geodesy 1.pptx...............................................
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
Sustainable Sites - Green Building Construction
PPTX
additive manufacturing of ss316l using mig welding
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPT
Project quality management in manufacturing
PDF
composite construction of structures.pdf
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
Construction Project Organization Group 2.pptx
PDF
Digital Logic Computer Design lecture notes
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Geodesy 1.pptx...............................................
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Sustainable Sites - Green Building Construction
additive manufacturing of ss316l using mig welding
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
CYBER-CRIMES AND SECURITY A guide to understanding
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Project quality management in manufacturing
composite construction of structures.pdf
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Construction Project Organization Group 2.pptx
Digital Logic Computer Design lecture notes
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Internet of Things (IOT) - A guide to understanding
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Model Code of Practice - Construction Work - 21102022 .pdf

Php

  • 1. BY ANCY RAJU Venture software technologies
  • 2.  PHP is an acronym for "PHP Hypertext Preprocessor"  PHP is a widely-used, open source scripting language  PHP scripts are executed on the server  PHP costs nothing, it is free to download and use
  • 3.  PHP files can contain text, HTML, CSS, JavaScript, and PHP code  PHP code are executed on the server, and the result is returned to the browser as plain HTML  PHP files have extension ".php"
  • 4.  PHP can generate dynamic page content  PHP can create, open, read, write, 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 restrict users to access some pages on your website
  • 5.  PHP can encrypt data  With PHP you are not limited to output HTML.  We can output images, PDF files, and even Flash movies.  We can also output any text, such as XHTML and XML.
  • 6.  PHP runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)  PHP is compatible with almost all servers used today (Apache, IIS, etc.)  PHP supports a wide range of databases  PHP is free. Download it from the official PHP resource: www.php.net  PHP is easy to learn and runs efficiently on the server side
  • 7. You must:  install a web server  install PHP  install a database, such as MySQL
  • 9. PROGRAM <?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."; ?>
  • 10. OUTPUT PHP is fun! Hello world! I'm about to learn PHP! This string was made with multiple parameters.
  • 11.  A comment in PHP code is a line that is not read/executed as part of the program.  Its only purpose is to be read by someone who is editing the code!  PHP supports three ways of commenting:
  • 12. <!DOCTYPE html> <html> <body> <?php // This is a single line comment # This is also a single line comment /* This is a multiple lines comment block that spans over more than one line */ ?> </body> </html> EXAMPLE
  • 13.  String  Integer  Floating point numbers  Boolean  Array  Object  NULL
  • 14.  A string is a sequence of characters, like "Hello world!".  A string can be any text inside quotes.  We can use single or double quotes:
  • 15. EXAMPLE <?php $x = "Hello world!"; echo $x; echo "<br>"; ?>
  • 16. An integer is a number without decimals.  Rules for integers:  An integer must have at least one digit (0-9)  An integer cannot contain comma or blanks  An integer must not have a decimal point  An integer can be either positive or negative  Integers can be specified in three formats: decimal (10-based), hexadecimal (16-based - prefixed with 0x) or octal (8-based - prefixed with 0)
  • 17. EXAMPLE <?php $x = 5985; var_dump($x); echo "<br>"; $x = -345; // negative number var_dump($x); echo "<br>"; $x = 0x8C; // hexadecimal number var_dump($x); echo "<br>"; $x = 047; // octal number var_dump($x); ?>
  • 18.  A floating point number is a number with a Decimal point or a number in exponential form. In the following example ,the PHP var_dump() function returns the data type and value of variables:
  • 19. EXAMPLE <?php $x = 10.56765; var_dump($x); echo "<br>"; $x = 2.4e3; var_dump($x); echo "<br>"; $x = 8E-5; var_dump($x); ?>
  • 20.  Booleans can be either TRUE or FALSE.  $x=true; $y=false;  Booleans are often used in conditional testing.
  • 21.  An array stores multiple values in one single variable. <?php $a=array(“a",“b",“c"); var_dump($a); ?>
  • 22.  An object is a data type which stores data and information on how to process that data.  In PHP, an object must be explicitly declared. First we must declare a class of object.  For this, we use the class keyword.  A class is a structure that can contain properties and methods.
  • 23. EXAMPLE <?php class Car { var $color; function Car($color="green") { $this->color = $color; } function what_color() { return $this->color; } } ?>
  • 24.  The special NULL value represents that a variable has no value. NULL is the only possible value of data type NULL.  The NULL value identifies whether a variable is empty or not. Also useful to differentiate between the empty string and null values of databases.