0% found this document useful (0 votes)
93 views

Introduction About 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/

Uploaded by

SiyyaArora
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
93 views

Introduction About 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/

Uploaded by

SiyyaArora
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 16

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

s a ser!er si"e scripting language.


Capable of generating the HTML pages

HT#$ generates the %e& page %ith the static text an"
images.

Ho%e!er the nee" e!ol!e" for "ynamic %e& &ase"


application, mostly in!ol!ing "ata&ase 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/obect declaration are al!ost si!ilar to any
co!piled or interpreted language such as " or "##$

http://phptraininginjaipur.info/

PHP %ata &ypes
Three &asic "ata types
nteger
'ou&le
(tring

#ore "ata types


)rray
O&ject

PHP is an untype" language


!aria&les type can change on the fly.

http://phptraininginjaipur.info/

PHP "onstants

..!alues that ne!er changes

*onstants are "efine" in PHP &y using the "efine+,


function.
-or e.g.
"efine+.N*(T/, .National *entre for (oft%are Technology/,

"efine"+, function says %hether the constant


exists or not.

http://phptraininginjaipur.info/
PHP 'ariables

The !aria&les in PHP are "eclare" &y appen"ing the 0


sign to the !aria&le name.
-or e.g
0company 1 .N*(T/2
0sum 1 34.42

!aria&le5s "ata type is change" &y the !alue that is


assigne" to the !aria&le.

Type casting allo%s to change the "ata type explicitly.

http://phptraininginjaipur.info/
PHP (perators

)ll the operators such as arithmetic, assignment,


*omparison, an" logical operators are similar to the
operators in * an" *66.

n PHP the string concatenation operator is "enote" &y


7.5.
-or e.g.
0name 1 .#y name is/.0myname2

http://phptraininginjaipur.info/
PHP )tate!ents

- statement
if +8con"ition9, :
//php co"e goes here
;
else :
//php co"e goes here
;

)lternati!e (yntax
if+8con"ition9, :
//html co"e goes here
else :
//html co"e goes here
en"if2
http://phptraininginjaipur.info/
PHP )tate!ents *cont$+

-or loop
for+0i1420i 8 342066i, :
echo+.the !alue is :/. 0i,2
;
)lternati!e (yntax
for+0i1420i 8 342066i, :
// html co"e goes here
en"for2

<hile loop

'o=<hile loop

http://phptraininginjaipur.info/

,rrays
. contains !alue set

each element has a value, "ata store" in the element.

)n" has a key &y %hich the element can &e referre" to

http://phptraininginjaipur.info/
Initiali-ing ,rrays

No of %ays to initiali>e the array.


-or e.g.
0ncststaff?@ 1 .amrish/2
0ncststaff?@ 1 .murali/2
0ncststaff?@ 1 .narayan/2
0ncststaff?3AB@ 1 .amrish/2
0ncststaff?3AA@ 1 .murali/2
0ncststaff?3A3@ 1 .narayan/2
0ncststaff 1 array +.amrish/, .murali/, .narayan/,2
to change the in"ices of the array use 19 operator.

http://phptraininginjaipur.info/
,ccessing the ,rray .le!ents

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_wal% ($ncststaff" &rintstaff#$
'' function to &rint each element of the array
function &rintstaff($names# (
echo )*+$names)'*+)*,+-n!$
;
http://phptraininginjaipur.info/
&o see !ore/
http///phptraininginaipur$i
nfo/
Thank You !!
Horizon Software
Solutions

http://phptraininginjaipur.in
fo/

You might also like