SlideShare a Scribd company logo
Horizon Software
Solutions
http://phptraininginjaipur.info/
http://phptraininginjaipur.info/
PHP
Introduction
What is PHP ??
PHP is Hyper Text Processor
– Other Names : Personal Home Page, Professional
Home Page
• Is a server side scripting language.
– Capable of generating the HTML pages
• HTML generates the web page with the static text and
images.
• However the need evolved for dynamic web based
application, mostly involving database usage.
• http://phptraininginjaipur.info/
How PHP Works??
http://phptraininginjaipur.info/phttp://phptraininginjaipur.info/
PHP Language Features
• PHP language features such as control structures,
operators, variable types, function declaration,
class/object declaration are almost similar to any
compiled or interpreted language such as C or C++.
• http://phptraininginjaipur.info/
PHP Data Types
Three basic data types
– Integer
– Double
– String
• More data types
– Array
– Object
• PHP is an untyped language
– variables type can change on the fly.
–http://phptraininginjaipur.info/
PHP Constants
• ..values that never changes
• Constants are defined in PHP by using the define()
function.
– For e.g.
define(“NCST”, “National Centre for Software Technology”)
• defined() function says whether the constant
exists or not.
• http://phptraininginjaipur.info/
PHP Variables
• The variables in PHP are declared by appending the $
sign to the variable name.
– For e.g
$company = “NCST”;
$sum = 10.0;
• variable’s data type is changed by the value that is
assigned to the variable.
• Type casting allows to change the data type explicitly.
• http://phptraininginjaipur.info/
PHP Operators
• All the operators such as arithmetic, assignment,
Comparison, and logical operators are similar to the
operators in C and C++.
• In PHP the string concatenation operator is denoted by
‘.’.
– For e.g.
• $name = “My name is”.$myname;
• http://phptraininginjaipur.info/
PHP Statements
• IF statement
if (<condition>) {
//php code goes here
}
else {
//php code goes here
}
• Alternative Syntax
if(<condition>) :
//html code goes here
else :
//html code goes here
endif;
http://phptraininginjaipur.info/
PHP Statements (cont.)
• For loop
for($i=0;$i < 10;$++i) {
echo(“the value is :”. $i);
}
– Alternative Syntax
for($i=0;$i < 10;$++i) :
// html code goes here
endfor;
• While loop
• Do-While loop
• http://phptraininginjaipur.info/
Arrays
. contains value set
• each element has a value, data stored in the element.
• And has a key by which the element can be referred to
• http://phptraininginjaipur.info/
Initializing Arrays
• No of ways to initialize the array.
– For e.g.
• $ncststaff[] = “amrish”;
$ncststaff[] = “murali”;
$ncststaff[] = “narayan”;
• $ncststaff[123] = “amrish”;
$ncststaff[122] = “murali”;
$ncststaff[121] = “narayan”;
• $ncststaff = array (“amrish”, “murali”, “narayan”);
– to change the indices of the array use => operator.
–http://phptraininginjaipur.info/
Accessing the Array Elements
– Array_walk(<arrayname>,<function_name>)
• function_name is the function that is written for every member of
an array.
• For e.g
$ncststaff = array (“amrish”, “murali”, “narayan”);
array_walk ($ncststaff, printstaff);
// function to print each element of the array
function printstaff($names) {
echo “<B>$names</B><BR>n”;
}
http://phptraininginjaipur.info/
To see more:
http://phptraininginjaipur.i
nfo/
Thank You !!
Horizon Software Solutions
http://phptraininginjaipur.info/

More Related Content

PPTX
Web technologies: HTTP
PPTX
An Introduction to HTTP
PDF
PDF
About Http Connection
PDF
Building Web Services
PPTX
Www and http
PPTX
HTTP fundamentals for developers
Web technologies: HTTP
An Introduction to HTTP
About Http Connection
Building Web Services
Www and http
HTTP fundamentals for developers

What's hot (20)

PPT
Common Gateway Interface
PDF
Serialization in Go
ODP
Linux Apache Php Mysql Lamp1273
PDF
HTTP & HTML & Web
PPT
The constrained application protocol (coap) part 2
KEY
What's up with HTTP?
PDF
Rest style web services (google protocol buffers) prasad nirantar
PDF
Multiplexing in Thrift: Enhancing thrift to meet Enterprise expectations- Imp...
ODP
PHP Training: Module 1
PPTX
PDF
Ws phpl1 php_apps_basics_1.2
PPTX
Http - All you need to know
PPTX
PDF
21 HTTP Protocol #burningkeyboards
PPT
Under the Covers with the Web
PPTX
Facebook thrift
PDF
Apache Thrift : One Stop Solution for Cross Language Communication
PPT
The constrained application protocol (coap) part 3
PPT
Fm 2
PPT
HyperText Transfer Protocol
Common Gateway Interface
Serialization in Go
Linux Apache Php Mysql Lamp1273
HTTP & HTML & Web
The constrained application protocol (coap) part 2
What's up with HTTP?
Rest style web services (google protocol buffers) prasad nirantar
Multiplexing in Thrift: Enhancing thrift to meet Enterprise expectations- Imp...
PHP Training: Module 1
Ws phpl1 php_apps_basics_1.2
Http - All you need to know
21 HTTP Protocol #burningkeyboards
Under the Covers with the Web
Facebook thrift
Apache Thrift : One Stop Solution for Cross Language Communication
The constrained application protocol (coap) part 3
Fm 2
HyperText Transfer Protocol
Ad

Similar to Introduction About PHP (20)

PPTX
Intro to php
PPT
php41.ppt
PPT
PHP InterLevel.ppt
PPT
php-I-slides.ppt
PPT
introduction to php web programming 2024.ppt
PPTX
Php basics
PPT
PHP - Introduction to PHP - Mazenet Solution
PPT
Php i-slides
PPT
Php i-slides
PPT
Php i-slides (2) (1)
PPT
Php i-slides
PPTX
Mdst 3559-02-15-php
PPT
Synapseindia reviews sharing intro on php
PPT
Synapseindia reviews sharing intro on php
PPTX
Php training in chandigarh - CBitss Technologies
PPT
php basic notes of concept for beginners
PPT
Notes on PHP for BCA and MCA php_(1).ppt
PPTX
Intoroduction to Adnvanced Internet Programming Chapter two.pptx
PPTX
Php intro by sami kz
Intro to php
php41.ppt
PHP InterLevel.ppt
php-I-slides.ppt
introduction to php web programming 2024.ppt
Php basics
PHP - Introduction to PHP - Mazenet Solution
Php i-slides
Php i-slides
Php i-slides (2) (1)
Php i-slides
Mdst 3559-02-15-php
Synapseindia reviews sharing intro on php
Synapseindia reviews sharing intro on php
Php training in chandigarh - CBitss Technologies
php basic notes of concept for beginners
Notes on PHP for BCA and MCA php_(1).ppt
Intoroduction to Adnvanced Internet Programming Chapter two.pptx
Php intro by sami kz
Ad

Introduction About PHP

  • 3. What is PHP ?? PHP is Hyper Text Processor – Other Names : Personal Home Page, Professional Home Page • Is a server side scripting language. – Capable of generating the HTML pages • HTML generates the web page with the static text and images. • However the need evolved for dynamic web based application, mostly involving database usage. • http://phptraininginjaipur.info/
  • 5. PHP Language Features • PHP language features such as control structures, operators, variable types, function declaration, class/object declaration are almost similar to any compiled or interpreted language such as C or C++. • http://phptraininginjaipur.info/
  • 6. PHP Data Types Three basic data types – Integer – Double – String • More data types – Array – Object • PHP is an untyped language – variables type can change on the fly. –http://phptraininginjaipur.info/
  • 7. PHP Constants • ..values that never changes • Constants are defined in PHP by using the define() function. – For e.g. define(“NCST”, “National Centre for Software Technology”) • defined() function says whether the constant exists or not. • http://phptraininginjaipur.info/
  • 8. PHP Variables • The variables in PHP are declared by appending the $ sign to the variable name. – For e.g $company = “NCST”; $sum = 10.0; • variable’s data type is changed by the value that is assigned to the variable. • Type casting allows to change the data type explicitly. • http://phptraininginjaipur.info/
  • 9. PHP Operators • All the operators such as arithmetic, assignment, Comparison, and logical operators are similar to the operators in C and C++. • In PHP the string concatenation operator is denoted by ‘.’. – For e.g. • $name = “My name is”.$myname; • http://phptraininginjaipur.info/
  • 10. PHP Statements • IF statement if (<condition>) { //php code goes here } else { //php code goes here } • Alternative Syntax if(<condition>) : //html code goes here else : //html code goes here endif; http://phptraininginjaipur.info/
  • 11. PHP Statements (cont.) • For loop for($i=0;$i < 10;$++i) { echo(“the value is :”. $i); } – Alternative Syntax for($i=0;$i < 10;$++i) : // html code goes here endfor; • While loop • Do-While loop • http://phptraininginjaipur.info/
  • 12. Arrays . contains value set • each element has a value, data stored in the element. • And has a key by which the element can be referred to • http://phptraininginjaipur.info/
  • 13. Initializing Arrays • No of ways to initialize the array. – For e.g. • $ncststaff[] = “amrish”; $ncststaff[] = “murali”; $ncststaff[] = “narayan”; • $ncststaff[123] = “amrish”; $ncststaff[122] = “murali”; $ncststaff[121] = “narayan”; • $ncststaff = array (“amrish”, “murali”, “narayan”); – to change the indices of the array use => operator. –http://phptraininginjaipur.info/
  • 14. Accessing the Array Elements – Array_walk(<arrayname>,<function_name>) • function_name is the function that is written for every member of an array. • For e.g $ncststaff = array (“amrish”, “murali”, “narayan”); array_walk ($ncststaff, printstaff); // function to print each element of the array function printstaff($names) { echo “<B>$names</B><BR>n”; } http://phptraininginjaipur.info/
  • 16. Thank You !! Horizon Software Solutions http://phptraininginjaipur.info/