PHP NOTE (Part-2)
PHP NOTE (Part-2)
calaulate S0m
The operator aTe ted to
Types operators
*Axtthmetic operaton
*Strdng operaton *
Asstgnment perata
Relatlonal opexator (o) Comparison opevatan
Boolea operator lo Logical operaton.
CYemert opevaton (r) ecreman OpeTatoi "
ihuise opevatios
Temaru eperata (o) ondfttenal operatos1.
AxthmetHC operatoni
I the
Case 4 plus (t)', mnus (-and
Osterisr(*) 4 both operatoYs qre téges the
operafors is hteqin and an
produced . integen tesult is
multtpliatfon muutfplles wo
numb togethen
Divston- Diviston one nunmber
by anothen
integets.
Some Useful opeseten re dasined humeie junction
floon , nound 1and , abs min: and man.
Stsng opeTatoN
Eample:
42php
msg woles
hmsg "No m6a s
echo "he Message s4msa", "<br>'s
echo the hap ssag
s$Amsg "3
27
wfndows tntemet eiplorer
@htt p//localhost lcs|my-php.
The me ssaqe .is wovries
The haPPY megsag n o wories
..
Example:
RelatfonalL opeTaton
! the OPpostte a =
pexator Maahing
equal t
not eual to
CreateY than
LSS than
oY egual to
LRSS than
Example:
temperature b6
4Hemperatuve >65)
:
outslde "
Tts., hlee
ech
7
Cutput:
OR
TRUE efthen fa or sb is tYu
The and the
and opesators peyormn
Bame
operatfbn. as do er
do
The dt4{rent between these s that the
presidence. and an ts qhex than hat
& and
itExanMple:
a-
operato meaning x
ncremert
Decrement
Etuwise opataton
Bitwtse AND
Birwise OR
A Awfse evdusive OR
Bitwise NOT
shift Jeft
Shittuqht
. .
Exam ple :
to detmal
bindec Con vetts btnay
, COstne
.: COS
deche ConYets,dednmal to
hexadectmal
:Convey+s dedma:+o Ctal
decot
Calcuulates eponent 4 e2
enp
tan tangent
Expression
the
Expresston sanything that has value
Cpevanals with the opevato callea expression
Yalue are
are data OY operatoss
opeiand
Synmbol.
Eample
sa t ¢bi
a x'k zb
10 +20
$a10
8Calan type Convenston
Example
value $Sum ib 4177, the follow
the
Produces 4.
Cint) Sum
ahothe way to SpectRes eplut type Comeston
s to use on the funetkon
Fxample
Code
$sum stiu 4.71 the followfng
neturns 4
antval C$sum)
tuwo anameters.
.. .