You are on page 1of 250
PHP, mie a weAlt shakeelS599@gmail.com Teale 0) acetate err ey PHP,MySQL Ln SRR Unt lil Ohad ASI By LPHP SL Ene tA 1 Sunt helalun IP UH UIL PHP Ct Lb BPE pobre SE Lid te SE ne iyo iat Ue SBEVL dr AHL Srvonte Jhb Me, tL Lael PSG TA Aus eh ti tee Ft Un eee ook te ni he AR UE eet SOILS Toe ib ARLE SAU UerStudent Li Subic tel L PCa lbw YG nti te rt E je PME tree Tux Professional Writer LiL LL bee rtid 7 LSU ABE th tue IS LAE TOL Tos Sal ean ntal ad ahaha & 2 A Beginners Sl Bue 2b te LAS PHP 22 Huw, Ure eo 6 not EF bute dadavascript HTML aS rFHTML So ThLet be hGHTML Sie Lbs BL ether CHU Thiet Liltebr bn UPL tel it le HTML ee ULL VE bi tL he AI Tee Part-1(Page:2) Cet) OT Bt A ate One ie tei fsFront PagaDreamweaverinc 27 UZ HTML ULE Th BO fore gl yee tb Pie LalBack End tie Thite ite TRAE Programs -> Apache Friends -> XAMPP Control Panel-ut¥ UUs 6 XAMPP 2 EA Gap Be ou SPUN ceca ie Pee & AMPP Control Panel Svc Apache sve MySql Sve FileZilla Mercury Install Directory: ¢:\xampp Status Check OR Busy..- Apache started [Port 80] Busy. MySql service stopped Busy... Apache stopped (Port 80) “ f& XAMPP Control Panel Modules Fisve Apache | Running (_ Stop Wisvc MySql |/Running Stop] MySql sexvice stopped Busy... Apache stopped (Port 80) Busy... Apache started (Port 80) Busy... MySql service started Sd Class rE) Saeed her Fe Glick Tool -> Glick Preference AL Arie A LU WIL Sus) PHP Designer el Preferences ‘BB General {i On Startup, cl Ga document Types id you know? {Ba Program Update gu cater RAMP and WAM are easy ways tointal the PHP, MySQL and Apache. Gl Syntax Highlighters baton apachefriends.or alenhcempp- windows hin) Code Explorer tp fon wartoser ver come {a Code Completions Ga code Te a Auto Coneletons Ga Auto Correctons (ere errr ste Settings (pho in) ici — exe (4) [Ccbcampplapachetbintphpind | (us) Example: C:\Program Files\xampp\php.exe: Example: C:\Program Files|xampp\php ini a Bomcers Inchde pkpin f you wan to debug MySQL Meg ations (a PHP Manual maths Gi Other Manuais Server paths Local server paths Ports Gl Web Search Intp: localhost [Cihxamophtdocs| Fles must be placed the hidas Folder inorder to use the localhost preview. UUW ECS XAMPPL, Def aut... Apply Cancel lew File PAFIGLIS PHP sk Apply > OK WL LA, 4 (Bj Document Types } a } HTML Micss Bermvavan - — Epwodusinm ~ — Guscaton ~ 7 O05, IM 401 Trend CSS 28 asoge = Tene 2 ccitlesWy Firat PHP Seript 4 efhead> 5 6 eboay> e <>php 1 // vhis script will print a Line on page B echo "Hello World! this is my first PHP script"; “ > 15 16 17 PHP Designer “out put-u2/Save < t£firs.phputc:\xamppihtdecs Sil 50 g-FEva(hitpillocainosutirst php) CPi erduai te aFieceh cM gohL Localhostyt bb Pec Tybrawser? Bes pte - em Birman - Eleirodainn ~ (7 pet intended Tego rigor | visor | r2po 12600 1 vapor Fagor | gor | 40 | S900 | SEO" veooe | veo 11700 1 | Hetlo World! this is my fest PHP script a a i vz Class-2(Page:8) er es!) ut AGO PHP Me Fut SI BHTML I, “PHP Welcome to IT Dunya "; _Gnzoutput a Welcome to IT Dunya it SLB sau Fed User tekE Wfogid ALi ge held SeusidL¥ PHP Tag (aylea PHP | Class-2(Page:9) Eres + Sai eo JiliwASP <%= "This is my first php script” %> | <% echo "This is my first php script"; %> + qetlted HTML, PHU php.ini -42Ce php.ini Pheer Ae TAREE ASP wt he sPHP FUL Solace Pe ef on off 9 SBC PHP ie Ue bn it Moy A ah Leino WiLL atti ne lA Lyf phpini os a dez uit php.ini LU Kampe TL AP \f exwindows/php.ini Kiev Pf PHP.#-Lils/.s) c:ixampplapachelbin/php.ini — Efervlers 2) ui(<2php 2> UF Py tuitceAte AL Geos rsaei tnd Bbw ot Ae shakeel599@gmail.com Class-3(Pag orn Sale lanl dared ig use yells g peed gS ternlegesd avg ust Ufo pole ev ad icy SOOPSSOOCeees esd hut Abe hp enh th ink af ec aereeel sie Gab REC te AUTRE Le Uns REE I eps eA we dnd O21 wf S Alfie Mb pALAEL 284 le aI SAGE See tee LPT PLANE) EO tnt ais // this is a comment: # this is another comment a DT EEE Le Soa A ti Puro i* this is a comment hone of this will be parsed by the PHP engine sf Bebra tn bo dphcnes Ga br tiatautl nee iH 6 EIA cof Variables SiAae Suse eS Sunt BA Boe Gi dat eds Fi it Zxdata container Gut 2 be Ae AU ey tal oe echo ( 5 + 2) Sifotairz AL Gednds 200 916 SLT Aare ee Se SIRE! et but eee SL echo ( 9 + 20) | echo ( 6 + 3) Class-3 (Page:2) Seer hbase Pues!) (6: Be TRL BAL| i aie ett Ae E user ut Untibtk ez Lit esp» Fetgumite pre x FEE Sali Ai) (Welcome Alito my site ) thi LT -S8y2478 Variables eereiz lb § Ke Ao Livariable- o ylTer th Variables (¢PHP eprtrt€ Variable oie PH s10-9)i7 (AZa-z)i7) pt8 Variable yt Pet PAL Prien in brte(Azaz yl (bint Amt! -urLkVariables — U8 Aan? sar $a_longigh variable name; $2453; $TT_Dunya; eh ASU Variables L121 OOK But LLL PHP I & 4 Variable Declaration Fut AGL wvariable —2-UtU'EUt te lend of statment r Gia We un ep tiFisiune LEE PEEL ome irk S assign ky Variable G*Urz= 5% Scountry = "Pakistan"; 2 Pakistan” assign xfs Muste_pt£(Scountry ) dkvariable HL US eft we SWGL "Pakistan < cScountry HF Statment GUL B yk woz aig WE Teeter S eit Siectin(nath) Anh eige Seria ge ody variable a tO! Ld of variable 1s! ut & Assignment Operater 1.6 ioe 6= Aut ire eT We bueg tL AU ==) AIP bt ala doe SLAG fide ofeae rire, anes GSUPHP Designer (I-60 Toff Te u7ut Lipp eof Equal uttghioue Class & (Page: chead>PHP Output: Sum is: 150 alGnumber_1 Lk variables vl BL Lary i the Serie ite Fut ~U2/ assign teks Fisie Ut £ Snumber_2 Snumbber_1 = 50; Snumber_2 = 100) "; Stest_var = 5; // integer echo "The data type of test_var variable is now:" . gettype( $test_var ); echo "
"; $test_var = "pakistan"; —// string echo "and now the data type is:" . gettype( $test_var ); echo "
"; Stest_var = 9.33; // double echo “data type is now:" . gettype( Stest_var ); echo "
"5 Stest_var = true; —// boolean echo "The data type of test_var variable is now:" . gettype( Stest_var ); echo "
"; > output: The data type of test_var variable is: NULL The data type of test_var variable is now: inte and now the data type is: string data type is now: double The data type of test_var variable is now: boolean LAs S variable ie o*9 gettype-\kwvariable YStest er AW ype king teu! £6LF-# datetype bi a SoP? gettypesiute assign (3678 variables tuxIGi_ ut eI Pee SF PHP vite 1S Assign i674 variables iSute ube Lute ey tie ubteceug hve hye th Sor LE ees trariables 6 We Abe hg ether A sotyper Ale tale thie? gottype "; settype ($myvar,"string") ; echo "The variable is now a:" . gettype (§myvar) ; > Output: Data type of myvar is: integer The variable is now a: string 2 Aig eftts-»-rvariable¥ integer type ti/2 "assign: 100M iti yre pt myvarfid & erg AST ane S sting PU beter h feu Vo settype Wort ise! settype (rtéUrys," ttsgdu) 6 AKL AL eke vaiable ie 6 Gy Ze SOLPHP Gb & A Se SiatCast uisettype yc den teutung hi Ge tee t Ke enh tthe. eth bese Fle LaGeee hey MCast Pag? tK3— Casting "; // 3.14 Sholder = ( string ) Sundecided; print gettype( $holder ); // string print "-- $holder
"; // 3.14 $holder = ( integer ) $undecided; print gettype( $holder ); // inte: print "-- Sholder
"; // 3 Sholder = ( double ) Sundecided; print gettype( $holder ); // double print " -- $holder
"; // 3.14 $holder = ( boolean ) $undecided; print gettype( $holder ); // boolean print " -- $holder
"; // 1 > il Cee er Fe Class-3(Pag es 4 Output: double string integer -- 3 double -- 3.14 boolean -- 1 3.14 14 EcastingA Ue shsfloating pointLsuilk Myc pt£ sundecided L futecKul LA A Sholder st kL sholder (Wwe ALA tisk Ufys Sundecided 243 Tbe Seg SAL AF sidoud let sundecided LY ty tz, Pai e bit thin Tie nteger|string Be Ge Korb SALEM hee Oe Teast Tbe Ui! «27 years ed U Pd usersinbotinteger AG tous” Butera Sage = (integer) Susex_age; print Sage; Output: 27 PAL Abeer ln intval (value) ;2t/ return, integer ie Wet doubleval (value) ;< t/ return, doubleslc Gxbyfi strval (value) ;2t/ return, stringnle Cbg Lu heute SnhL wl tts ey osteelsbeprint 1 echo LAG Ae Sti eRe lef! Ee ONES pA Sere UC iUtstringy 2% prtint Lecho GSE 4 Estring 22S escapesi ue 2 Se etd Oe Weep A tt 6 Let Class-3(Page:8) A I Love Pakistan" Gel escapes TEL utvyaid eet oy MIL Bet te de TN Aissrge 6 Sega Se AVEO LS IIL Lr fe print | echo Sey Sivet we Liege Seyret a a geity = “Islamabad” Output : City is: $city City is: Islamabad BEM Mode e Gre BWA tre Ft Le hE Unt Ln PhEet wie Seer BAA Se Eg PHP 24 bese AS PHP ot dU Bind PUL LAPHPIEL 4 AU Se Aen fb See BLE 8 AU inte UES 6 Ur Se WA LG eds 3C PHP Se ZEND 5A Sexi tal ¥EPHPUGT 8Uir wee ie 62 ey PHP Te Sate Se sred PHP ye 10 te De urhystiol PHP 9 Ue yb aoe boo shakeel599@gmail.com SOoeorseooos Class-4(Page:1) errr) Pee Sauls plu! eat L etree EIGEN SOOSOOSSOGSS (Operators jamal a Fg hs ES Pecan lisse get assigndol rete e koe Mac igihr Pac drag tr OGRE IA GSI L thn /aut L (symbols )etik 2! stu operandfic AY 5+10 ele L jeg ieee Gt S015 br Fy se LAK, oie gT+ ol operands «1015 Afi GEL PPL Lute bh itolnL operands The Assignment Operator = (=) bee tne a bry el cag ie hue $name = "shakeel" ; Arithmetic Operators gag 13 10 +3 @ + 3 10-7 ia » 5 lo/2 eo / 20 lo*2 we * 1 1033 up 8 LoL if operand’ SAE rte LEO Ae Lee tbe ctype 2 Se zoperand Class-4(Page: eas ma hear tL ea! Le Concatenation Operator = C.) treks ut tiralic nl oy Boy Ate tks "nelle" . “world” vib Ayzs"helloword’ S$centimeters = 200; print “the width is ". ($centimeters/100) . " meters"; Output : the width is 2 meters Combined Assignment Operators © Arithmetic iz 1 pw Fi Se LAL Act PHP whe assignment operator SLeweeA Jeune bly, UAL Concatenation Operator .s!Operators A uedypireidi Ltt Lie daz Soperand | Sty eee Wie Lipgitwel Altes: 1% SAGEM GS ne Sah operand te LES operand Sens amt tea ES") CombinedAssignment Operators eta Sy =Sy+5 Sy t= 5 + Sy =Sy-5 $y -= 5 -= Sy =Sy/5 Sy /= 5 f= Sy =Sy*5 Sy *= 5 te $y = $y %5 Sy = 5 Ss $y = $y . "test" $y .= "test" = ‘Comparison Operators = hs false | true F booleanute UG tule tire Le sn fik opevandse Wests (ated tine ge Jat (it, while) control structuresz-< Uyzs Lutte the sesx $x <5; ~£ fypitalseAin10 ted sx wid Syptrueyin 3 osx AL Comparison Operators (se a] 100 == 100 (Equivalence) x 20 (Greater than)< if lvl operandyl’t > true 5<10 (Less than)
    = 15 Lf vnciesstroperandl >= (Greater than or equal to) true 5 <= 15 ELionidnt operanduy < ess than or equal to) false 5 === "5" Ustsamal Data type Lives operands Us» = (identical) eet 2) eee mciea EL ES Le ALestring — Hes il—)equivalencestup a Je17-L double integer ols ja hy ut ert Logical Operators = (and, or, not) ~utd Ayptalse Ltrue xtsbooleanwic VLG IA Miz ci, ste tel Con) | (DU Ale ys trues brtme IF Bek eTe (OR) 11 (Sage == 27) || (Sage == 30) PIL eie271tsage Ace $3002 EP AGP Mort te bg be tere Av usitacrue Hur Aiezotsage Aulbeute rue ystdetrue Sypstalse AI T25 Usage Ale tetruew 92 butruey® Yor fT Lttruth table VoRALutuxFalse eel Gi LEOR | eperand-1 | parand-2 | Result true true true false true true true false true false false false hfe Teruety LtoRULevleteut falsed!y ¥ operands Kase hfe aba break Jee Jesor Cr SS Cele mctinet? Class-4(Page:5) ere) Pel (as) Uply-false deve tlyxs true gum true PU Us aie GIF lana ) 12 Ade Moin S21 AG ig SAE ABA te tp Sethi Joe thet (and) | bus (Sage == 27) && (Scountry == "pakistan"); we thle Jeas thi Pe typsraise JE nth yb eh e foie truth Wand Ai ypstalses Ale oly Bole Jeo ALi vie Bb le Se bE bnEiolik leUitLk table Sree G9 SAND (operand Operands? Raut true true true false true false true false false false false false Utuntleriitalsed!y,Laut trucoperands Uh Ute ube TU <= > Jel AND ELS ge Ce beh Class-4(Page:6) Crwnety arr eA ik Tot «(NOT :3 Octeo Er ee yp trveictalse vic typ false Frtruess/ sie AG I Increment, Decrement Operators = (+, --) 15 iat ni Loops nly le CFL So 1 ey integer typerie ty ULE KE BA ge merenenting sir JEL OK LG Ek Decrements(--)sl Increment operater #(++)utZ decrement ing (si sJb-ut! operator sass; Satt; ¢/ $a is incremented $a--;// $a is Decremented 2 Post Decrement Mut L6--sIPost Increment MEL b++01£ pel Sys p FAL-—S ere Increment GL 6a tl ey Ae LIE EWE ot e-utL Pre Decrement $a=5; +4$a; // $a is incremented ~-$a. // $a is Decremented Ue iga++ Sef Post Decrement{Post Increment iase GAY UtPrefixs Postfix! Be trdecrement {increment sAnle dxupueh f variable te Mult Ausle_te Decrement Increment kyssdé Ut++$a Se Pre Decrement \Pre Increment wot ea Li UTA the Jere Se tbh fisie deeipuks (Si Post Increment"; print "The value of test_var is:".$test_var."
    "; print "By using Post Increment the value of t print "
    "; print "On next line, the value is now: print "
    "; //using Post Decrement Stest_var = 5; Print "

    Post Decrement

    "; print "The value of test_var is:".$test_var."
    "; print "By using Post Decrement the value of test_var is: peint "“"; print "On next line, the value is now:".$test_var; peint "
    "; //using Pre Increment Stest_var = 5; ".+4$test_var; print "

    Pre Increment

    "; Print "The value of test_var is:".$test_var."
    "; print "By using Pre Increment the value of test_var is print "
    "; print "On next line, the value is now:".$test_var: peint "
    "; //using Pre Decrement Stest_var = 5; print "

    Pre Decrement

    " ; print "The value of test_var is:".$test_var."
    " Print "By using Pre Decrement the value of test_var is:".--$test_var; print "
    "; print "On next line, the value is now:".$test_var; print "
    "; 2 output: Post Increment The value of test var is:5 By using Post Increnent the value of test_var is:5 On next line, the value is now:6 Post Decrement The value of test var ist By using Post Decfenent the value of test_var on next line, the value is nowsd Pre Increment The value of test_var is:5 By using Pre Incranent the value of text_var Gn next line, the value is now6 Pre Decrement The value of test_var is:5 By using Pre decranent the value of text_var ‘the value is on next line, is:5 is:6 ist Class-4(Page: Geer machen EL altncrement = URAL Ati bya etest varfib Pe et aL gst increment twGids Sky utpost Increment Pe nlPre tnerement fue deg Sow 1M Asie Ger ho Aide b ne Betzee dnd Slaw 18 byazcil si tpecrement Constants = Kobi Pr yhut eda tert, Dei eiesutvariables FuZLe Hie PS eyconstant-uf Lb constant iutew al pnt e butane de Decrement PUL ee futmethod-Vaction|sl method LZ re klotHl pbb fi SESE SPRL EL eA faction te pile py get ihepostilyMie Ge method Met Ril Lilb usin Bn a6 Uy TL e page php tubules UTIL it UE Le ier le sally CEN bl iui toe tipurysiul bebe tl form tic: /xamp/htdocs US save pt myforn.php Uli c: /xamp/htdocs/forn LABS (myform. php)
    Please type your name: = (tL dataform.php MV bea Mi PFFIGL ILS save Hur SUL en LEU! UES saveut c:/xamp /ntdecs/ form Page:3) (dataform.php) eA Form Data Ut Ete BEALS save gC INL Sh http: //localhost/form/my£orm.php ETI LAE say Hello awiebteltrextbox elt CELT Le Lt enteral itp tag esiiuntal shakeel uttextbox 2AUBELG TG, Hello Shakeel se pet phy, UPS ek ebdataform.php fe get£ action wth vitid Ae yesmyzorm.php Ename ale Ae Pit pi SLU frost But e/ Ud cdataform.php t3 Ku CIB Ter En tLe act SOTA LIL HU Tap tk txttvame Mite afl Utdataform.php SMS let say Hello MimE br tspt title SF submit eq alle ky fie pt sname L Aol EY open G6 gGig KUAutdatatorm.pnp iS assioniLAMb sof txtnamecey! $Name = $ POST['txtName' ]; Se @arf he theta sis posrFssea Kits A geibAa sey ks @ Ma dS ele tebLmyform.php L Kaw textiame BI feud To yt ptt SF cextbox lultiellom ELF tbe utter AMee pile OY18_Post hehe Shorted giame o Class-6(Page:4) print "Hello ".$Name; Aculgérsubmitf dataform phppbit2 ltl submi tlh pth iteextbomieCat pln huge Arye bellow gl Modal cextbomsle uSeyis_Post PbPpLianO Reine yrtylee gi$ Postapre pt Leto iueterbin fi a AL eh tig rte nk $_GET = wocibetie Ly lhesCurr teen yquerystringuize oboe SE nésquerystringatudilyt http: //www.example .com/search.php?keyword=pakistan ahs File ptLkeywords [ub fouerystringfi#l- Luan Sut aude it Jet vie Sivturttig ln bspa? lL t£ Ge turtfiuerystringse pakistan Saburinfouerystrings http: //www.example.com/search.php?keyword-=pakistanscity=isb teizee SQuerystringscity Iyyuslkeywordfiutouerystringsptdeulet Ee Je s_cer FAL (Pod ouerystringfiple Go OCG sedirmre Lf ey Be ptCgettc: /xampp/ntdocs -U/ save apt£ link. phpta3£c: /xampp/ntdocs /gew! (1ink.php) USING GET</TI'TLE></HEAD> <BODY> <A href="get .php?site=ITDunya">Sending Querystring</A> </BODY></HTML> UMNILe: /xampp/htdocs/getal SY Boxe Xi tt SiGLvILS saves ey -W save epifget.php elereea st) A (get .php) <HTML> <HEAD><TITLE>Get Querystring Data al(http: // Loca lhost/get/link.php\ THI Ale UL Le BS savel foi eld Sh Sob ter Py AM, Sted Arte bile Lye U-Ahttp://localhost /get/get .php?site=ITDunyalelal he F ABU C11$_GET Utget. phpS*Sepu/stule 1TDunyarbse Querystingtisi tevtURL Fequerst ring dS QOBLIEL AirigetutmethodLl pipe beau Leta tL Lia ye oa uf s_camAe there ¥urn Switching Flow « emu UL Uiewis statement Febrero oie yt inet ficeSh Soi titer SLxtalsebt ruck ite nPwebicg Mit AGGitie wiuutrrieswrth te decisiontdte L Heist PBS gin hasnt AS inde te BES Af peace Sole Son eee YE ae iS nb tasw7/ Tae felons cee ELEN) be GIA SS ch leg ee ASU ce al Saad a ae ge ge te AS Sie ple sb 3 a dete Spl Sia sila TS My tle gd py Se OW My ed S15 apl RSLs gl pI Gaul gal v6 pp ATA asl 91 Goaly 287 CA be iba tlhe pobre AF Ld vaed tuber tas par Pl ot we Ep izg bet Fe wehgonet zi Jide det ruet i up condi tion I tie oft! it Ste ude Cis bce S bel (jue if (a condition is true) { execute a line of code; } Sprint! ne iieas? Foun th ity tL SAA SUNS pub Re LE Ent execute goto_otnersnop() Ute ASL buts nic SUB UL Se aE La Ae KE, LAL fed gect 9X = 27; $¥ = 30; if (8K < $Y) ( print "§X is less than $¥
    "; Af ($X > 8X) ( print "$¥ is greater than $Y
    " ; Af ($x == $y) { print "$X is equal to §¥
    "; if ($X <= $x) { print "$X is less than or equal to $Y
    " ; if ($X >= $Y) { print "$X is greater than or equal to $¥
    " ; af (9% 1= $x) { print "$X is not equal to $Y
    " ; ourPur: 27 is less than 30 27 is less than or equals to 30 27 is not equals to 30 hyp iL svaisx ted phe tec batruer Eco bE ites ib Supe Br Ben Ak Ais 30K tev aly 00 sx ses whe Ute icuigte Ar Uso Peo assign isyalsxcikye ho Jberi6’e lseUsif ALi tATLprexecute Meili Aiebrtalse@ porte Speyeh 1 LA Welse Celera (as1(-s)) Cee ben! if (expression) { Pyrexecute $54 5 le perue pty tS aS } else ¢ Crexecute Iu acases uw al , Ue Sabed Mlle tL password ke ie ue Agi isute. Se bese ss Labed dS spasswora We AG AUE LLL if Gets SiWersewdnfalseX IU i Gb Ade ibibo Scar relae ule Bpassword eh ELT eb, bneicome Lif 9E Sophy ge VM bec terror Lite brexecute ~BrexecuteShWelse) o/b kyspassword UkeWelse if Ain & pte UPI tl AG PUI SURE iii brtalseth tert it uo url AeriWelse if if ( expression ) ( LABELS trexecute IL bxtruevt AA ) else if ( another expression ) { LAMM ich d g Wikrencoute LF bt eB i wie bertalset WE iebngh ) else { Erenecute Byutcases~e Ghee em ee MLSS ith A sui SEs, c:/xampp/htdocs JAB ates ite Lub Serie li cvdd. per LICL the PUA BL IE ep SAL ~AS save apt quess.php tae shead> Guess a number Smumber) { echo "

    Your guess is too high

    "; echo ""; } else if (Suser_guess < $number) ( echo "

    Your guess is too low

    "; echo “
    The number is $number, you don't win, please play againshz>"; } else { echo "
    The number is $number, you win, please play againshr> "; ) ) >

    (idbnidden Look Sebnd vp e HK submit Ol ALA aiid atpAg Fisset fitout cull pre Aue ibe ne SU GHE assign Lieu ute brassion dln te Mog EH issete. Pietypstalsesstrue debs $site = "IT Dunya"; isset (Ssite) f/MSgpatrve = btsubmit Ose inde lp hOrll Ate eI PL AAG IL Cee Ee a ACrandomed iL brie Se LOW rand ( Ltn E Let Bolg eut Aut id sh S textboxL piitlerEsuser_quesscbe Mbp hur Litalyigefassing Gin bModre rand (1,10 Fuiichy fle pt£ $number Arete we ube De BARibis Kutt AGl suser_guesse3 Le Siegal whee Aer ned pole we Gi Gihinsie(e vecnd tel ysal if (Suser_guess > $number) { echo "

    Your guess is too high

    "; echo "
    The number is §number, you don't win, please play againchr>"; } DGS iS else it APL yntaisetecis Agee Welse is 64 ip Siege Aisle Uti bsteks else if ($user_guess < $number) { echo "

    Your guess is too low

    "; echo "
    The number is $number, you don't win, please play againchr>"; ) seep Se Wh Lbntalseg@ il i turd wi /be §le Sve lseut? ia! we EL ig IL bet Udita Ai Se Kt bE zaslely, else { echo "
    The number is $number, you win, please play again switch statment
    Please enter a number between 1 and 5

    Class-7(Page:3) Teer eas be Lpids IL br Guid le Metextbox fie pt Cnumberd & ee Py i Hi pig Suser_number -elneryi bE e Ue one trued ite Whiddenc pt£postfi wig th Bei fe switch Au cok ts S(numberdtextboxL put kak UL ALG AEL ibs at case case 1: echo "You Entered One"; break; CAL ELAS siz, 3, UALS Sh gnc Li efi tsmi tor LABE BLS Gutewiten@Ae yi detest suser_numbertte pi hr tye # BAUcAsecho "You Entered One") way liebe A Bteasedt ay te ey Wii ten Sat rues tL ABS 2,3,4,5 (Loops) = BEd ntalseltrueL HUG ne uyel, conditional statementi fey! statementl@iftie Gtr Gln dreruegt Mitty esse brut vlan Betti L nexecutes Acontentsyt wide AE conditional SLY Gun ep Ae Bef fia 000 6 Az 2h toe trexecuteltustl ed Atntrue Fora! do whilewhilewsud ee utpne-L uf Al* oop ~ While = feruesle VBS result Mit, Ke Dede ei tule Ke euhile loop et VOIL AxzLntalse while (a condition is true) ( Ceihe crue Uhh CEES To) erent ET er TNS Uliigtrexecutemiflinerucl A result! ile tug Aaa thte Upalte terete Uti break neil bus bcondi tion ft ateiuie RMU 2 A while Statement
    php $counter = 1; while ( $counter <= 9) { print $counter,"
    "; Scountert+; ) >
    Output: 1 2 3 4 5 6 7 8 9 LA GRA tuhile loops Gb Aliya teu! while ( $counter <= 9 ) eid tscountensbeun i OIL Hteddntbe 9 SoA Gi ey scounters® ect iit he Lerdl scounterag Oil Hide te 9.1 ffiet rete a1 BL bie 1 print $counter."
    "; $countert+; Ta ee MySQl GG Sn 2bS scounted s/w KU ef increment/ Scounter ili See rd t Rye lac Si Le Ai IIE bie tunika GI le true ke Us Wibrincrenenté kat scountenté bseiz2 albrexecutes WOE Meche the 9 FAK buP Loopmhebutal seus tunilenEemsye onl scounten sgh te pete tintin be EPO bt int ind edt Fy Lincrementy Scounter Hib increment A Ntle the ote ib tscountense-Gerutirboonaition EW ie OE aaa tocounterste dnt —do...while = Beda glcondi tion iti tee GA subi leniMigke CAS whi let gre etl Pl he yA ote tnexecute do { // code to be executed } while (expression) ; Susie Spe shine Lon Pt de sb LPI AZ be Tole br boanh ig bn = t&dowhile paputhtdocs fi bien tri slie dmhet ee ile brexecute tS save BE The do...while Statement
    \n"; Sum; } while ( $num > 200 && $num < 400 ); o>
    Ta ee MySQl —For «= sideclareh eyntell PSH AUS ile be einen Unie tb Uru & Sdecrementlincrement4U puttin 2 Age ie Eur / initialize decrementt increment s1L Set Lu phe cs Uryscounter faut vuniler > lp kedtor PEbetedinfinite JL J¥tl increment Bohr btuLS eth Ari Store bkercompact OA fiers Luli? for ( initialization expression; test expression; modification xpresion) { // code to be executed + LAU bel istor wee El Using the for Statement
    "; y >
    Litkopte de yentia Mite Bl iL peor Sekine? BP ecco id hy scountertdel pet S assionddMug z-Scountert#iZ/ decrement} increments yst2u tu! $countercerz J tS BAP teincrenent ys Atner SuiiLitecrich Gr Qt tikes day ~Ebwctalse@ ibe ide CR) tI (preak) Lac a Toba be Se AA eZ nexecute dem trie MR at whi levlfor boSPoreaks bi sul fd Lie Ble ost SIM ye LIL tESELS Cee ge itr FP aaa) a Using the break Statement
    "; , >
    Sitar se Le GAs pile tyr Verror IG pba Lh AA fob warning ht UL LAE GOASE Warning: Division by zero in D:\xampp\htdocs\loops.php on line 13 San00Putteyd stemp-be ol —4Filikys (scounterfistesforl Ate Spl Ose De Ate eye ei tite Aste Lathe full LY scounter CEA Ske lt torearino ih Ale AGS scounter dt eb PR Sue Sb EIS PLM file TU he swarningut papi Aezof 4000 On eA r Sst ulnteby see us0e ferrorbt aT Semel if skipscte ul continue Statement, 2" Bu . Bitin tA Myhe PULLS skips brevis uf continue statement Benen upgiijbae continue-Rethrend upgiiybhe break Sbod Tee UALS etd skiph edi MySql a Using the continue Statement
    "; ) >
    ES skip nseUrtcontinuer £ preanL Aut! ededidiur tees warning tf iitwud end upgslad® Ke se LAR dlc boxe scounter ui we LS skip#continue statmentzupe wxork Scounterzue tL y Forbes or Ulla the dll tscounter, Ue e th ff efor ths pointer Ste dba 10d $counter Nesting Loops = pote retbwen fLudynamic HTML tablese- gE Ari Persil etehie KAS savetthtdocse tL tables phot zi Stitle>Nesting Two for Loops
    "; fox ( Syl; Syel2; Syte ) ( print ""; for ( Sx=l; $x<=12; Sxt+ ) { print ""; print (Sx # $y): print ""; } print ""; » print ""; >
    FA hs Be thet ra Prowse S Rey < WI forwtiL oy ford AAI bY! ee pin RCE LL generate KL iP eee sl WL Le thcta> Bowl to tusen tao hob Lut ( Y 2) Pi ILS ec rth AL hb WELL a LL bg A) AoddSthe (evenah At AP ETI AL A reer ith A nee WAL LILO op agell (2) GTi be rine 20pbhe 2AM AE dayenL 2025p aby Lest tablesle fgef 100L york 2002 SethinteS displayEtievh, ub a020 shakeel599@gmail.com SIOSSISSIOS ISS em satel G5 ute WS GasgiT YS cabeuli yd Gas ss! UsSa dl «a gil ELE (String Functions) = LL byl e te byt Lie assion lle itor fer FP aa aes) tN WES pe SOUS AL Chega He te Behe lal to by lt iLike Ste uf stuayl 3ARF $str = “I Love Pakistan"; Pee A (ELIE Ore drassignt eA te obi tin fie tlestrh ea LF ihe - rtigstre Uta Atel teinoehien lind pone af te by P ria LE Aad get Bnreting hogs Er oak FRpuPit nodded 7a US Leu biowealutrh diene “U6 PHP Coreg Sree n SAME EEL Mi Ly ed chr 0 seth bettetbasciisyS chr (ascii value) We Stest = che (65); echo Stest: ve output: A ord @ -eyjubascii Mile WAAL el chry ord (character) Je Stest = ord("A"); echo $test: Yroutput: 65 ee me POLIS) trim © Beers ee Pps Flt pl Bo "" (ascrE 32 (0x20)), an ordinary space. "\t" (ASCII 9 (0x09)), a tab. "\n" (ASCIT 10 (0x0A)), (Line feed). "\e" (ASCIE 13 (Ox0D)), a carriage return. "\o" (ASCIZ 0 (0x00)), the NUL-byte. "\x0B" (ASCII 11 (0x0B)), a vertical tab. trim (string) Ue $etr = trim(" I Love Pakistan \n"); echo $str; wr output:I Love Pakistan eral ‘strien(string) Ue $country = "Pakistan"; echo ‘length of $country variable is:' . strlen (Scountry) ; se output: length of country variable is: @ ucfirst © -th bast (upper) 2 AB Lage ucfirst(string) ide "my name is shakeel"; getr = echo ucfirst($str) v© output: My name is shakeel CEES) Coren S ET eT TTS ucwords @ t (upper) VL BL fa Ue $str = "hello world"; $str2 = ucwords($str) = echo $str2; 4% output: Helio World strtoupper @ eth bit (upper caser brent Sat strtoupper(string) Je $str = “hello world"; $str2 = strtoupper($str) ; echo $str2; 3 output: HELLO WORLD strtolower © ~ethtrt (lower casei tf bry strtolower(string) se str = "HELLO WORLD"; $ete2 = strtolower($stz) ; echo $str2; Yr output: hello world Cee) rere Ta NS strstr © ae Ay PS AL PHL AL Lt GIL Mle MAL Lio rt strstr ( string haystack, string needle ) Je Sonaii = *usezGexample.con"; Sdonain = strotr(Gomaih,*@") ; echo $domain; sr output: @example.com substr © we thyp fey Lusky substr ( string string, int start [, int length] ) Ut echo substr(‘abedef', 1); J) bedet echo substr('abedef', 1, 3); // bed echo substr(‘abedef', 0, 4); // abcd echo substr('abedef', 0, 8); // abedef echo substr(‘abedef', -1, 1); // £ addslashes @ Zt fet databasefiAvalnln eC) GU CMA LE Seca lh LeriPWadaslashes hh Until rn Lite Nigh d ook pA te erro tole kM He Hu addslashes ( string str ) Ue $str = "Pakistan's"; echo addslashes ($str) ; % output: Pakistan\'s stripslashes @® OH a PEI PCREL A taddslasheslbl pe LY slashesdie Lr" aT Seema Ld OF ifutn in Koa database Seu tig UPA ble Lesh ole ts web hui nh eit ald Sai splay string stripslashes ( string str ) MySQ We $str = "Pakistan\'s"; echo stripslashes($str) ; vr output: Pakistan's htmlspecialchars © Soi Punt SOIL AL Le tL petnn entities SARL fs ch itive tpi fil fd Bye (comments) Ge rye te tL AG bebe c 210006 IL Met bY javascript ABEL ine pte LOE SS Ah Tal AEE STIL ibe wig ad UE be nt alert ped Fei bese ee Kare shone WLS hacking UE Yara SP Se taatabasehAsgat string htmispecialchars ( string string [, int quote _style [, string charset] ) Ue $str = "I am shakeel"; acho htmlspecialchars($str) ; ye string becomes: élt;hlégt;I am shakeelélt;hlsgt; we Result on Page: I am shakeel str_replace @® -ctAbye replacement string #1 ufsearch stringgauattoy” str_replace ( mixed search, mixed replace, mixed subject) ae $str = "Hello World!"; echo str_replace("World”, "Shakeel", $str) ; se output: Hello Shakeel! str_repeat e@ etl repeatiny str_repeat ( string input, int multiplier ) st echo str_repeat("*", 10); Sr output: tteeeeese nl2br © ne Pht bro Latta I nA LOS nl2br ( string string ) se echo nl2br("Errort :\n Cannot connect to database server."); ve output: Error! :
    Cannot connect to database server. md5 @ encrypt Bry Iuliy-e Woyfs ue txAnexadecimal 4S 32f2ma5 hasho fa” wet IAL SL md5( string ) se $str = “Hello”; echo md5($str) ; st output: 8b1a9953c4611296a827abf8c47804d7 LASe Antu tolep lef Lent A WEL Seed tes -ySend pnp neve 2G pL Ep 8 bt eA Ube I CT, Gere pea as Fans) Time|Date ua Perle teuig npg kV PnP Se PI Bute PEL time widate LPHP Ae! Puts Heuer Fo euPuleutnL ait /Motimessidate timesldate AFeonlinewthf Aine A WEIIA te Ary dele ixampe LAW Ber tL PEPY Le dthost et up nL yl “UL-O OPED Coreg date ASG Mert natestime 2d date @ wer PILE AP ecatestime Buri? string date ( string format [, int timestamp] ) J utparaneter £W(format weit Ute sdte L date ius? GAL RR Ute etl L \Podatetime Id 6 Ayub tt GbE Myst ( ve Je Khas #31fe01 Bon riontnonl ee d San = Mon pth bref Saturdaye Sunday pearl Zu | (Lee #12201 (teat Pure m Dec & Jan peek | M December< January cigs | 2008 | 1999 (eure a | ¥ 081 99 He pure 2 y PMLAM (tren ntirmamL ih | oA 12201 Gee duy Lal puree tec | oh 59201 Puri | i \ 59=01 ue pure | 8 em mace eaas UMAR) LE Lidatest ime Aba et We HLF cater echo date("¥"); //2008 (year) echo date("m"); //11 (month) echo date("a"); //25 (day of month) echo date("¥-m-d") —//2008~11-28 echo date("d/m/y") ——// 28/11/08 echo date("F d, ¥"); //september 28, 2008 echo date("F 3, ¥, h:i:s a"); //September 28, 2008, 12:11:35 am checkdate @ ec ypstalsesstrucintecber Ale LBS darecth im bool checkdate ( int month, int day, int year } wet! validate Aste Wparameterty SE checkdate(12, 31, 2008); //returns true checkdate (04, 35, 2008); // returns false time() © January 1 1970%_ tebe timestamp. téyzsunix timestamperr Moet te nL bc bind terbae ile tals FerS SPU < timestammse Hig oat EDS PK date se pee ELE Gb Lust stimes tamp SnextWeek = time() + (7 * 24 * 60 * 60); // 7 days; 24 hours; 60 mins; 60secs echo 'Now: ‘. date(*¥m-d') ."\a"; echo ‘Next Week: '. date('¥-m-d', gnextWeek) ."\n"; x output: Now: 2008-11-30 Next Week: 2008-12-07 Bosley Liv pnp neta ya rted£it fd aace tee shakeel599@gmail.com cesscceseces a sysel G58 Gee WANS ai S Gis s) ay sl See Sl alg FP aa aes) (Functions): «= Leth 2 Mol lephh te PE eB puite ine ven l ape LT EL eo ye pr Rath PUL ty LUE Su el Pulegerbut Se eee Ayr hl AK yisle Craw maveriaisdee nul Mee ye Lehiyine ie ev* 00d processor earhwuntbe sb ee tule wget Rt ie the PAL eb tn ate Er bun Frit bn Oe ft le bork Foie ox AIA oS (Tuite idtc EL burn Mh tenI£ Aur (erinder) Hz ef Loi A hot, ‘WLI Lio rhn eo ty dadt Ml Aisa tiitlypbtL WE othe sefolévle Wargumentshe eos abez Lib gerrype Hi Fl S calle dren At eA Aatl oA oh meth tls gettype($test) Lib Hargument fle Pull Pa S te udm Ie Pek Li paey ai ue Any tL argument hkl stestutubdplugE argument Mug tre OL fargumentsnls some_function( §an_argument, Sanother_argument ); Pvoettype Se EF (return) yubbtehebe aroumentoy*edeut eye ten Tile AE ue MU eit ipan Re yah Gt nth nab ee eure A n¥ eunctionfL bey function some_function( Sargunentl, Sargument2 ) { /J function code here y CEES UT) erent ET ery NS zon koAargunents htt Artbewi Li tel tunctione Lt, is, wtboy thai S save tL function phathtdocst pel ibetrigt Declaring a Function HELLO!"; - bighello(); > output: HELLO! argunentute™ Une Lut argunenth Mlle pt bighello fd ftltut white Lez Sthigis Age argumentzve GrenAtge tsar eat IRMA Be PAL car hfe vigneroyefgi At Up argunent HAL iret P LES car strc lz br Fi ~O arguments up Lb iA LxSilrargument er Ung LS ZB cheat Declaring a Function That Requires Argunents</titie></heaé Sbody>caiv> <7php function printBR( $txt ) { print ( "$txt<br />\n" ); d printsR("this is a lin printBR("This is a new line"); printBR("This is yet another line"); a> </dive</body></html> output: This is a line This is a new line This is yet another line em argument Lake eve (tls tari cathe tL printBR iL Autueu! FIL LS ca Pee ery SiG avoumenesifite ee A nh EV argument BAI le call shh PAL Ff SB he hs Fargumentfi CLIT ta Ae Ble ube ar FUL ot dysstxtd argument ul ak UAE AUR yp Sabb tae to Fi peg ceil FP aa Ns) yj cto <head> <title>A Function That Returns a Value
    Output: 8 peg Lute Vparqumententitee iti Le tC adanumed AtUeu ee Ajab ie e returned rut ltys resul there SFL FE Soy CPE be phic oP ute Sy il sresultie eck print addNums(3,5):2VULGuusle V cal PALL toy Hl Aout eS displayg@Uprint ul Sys sresultL Gul Aus, Variable Scope a phagmut ZL Local variabloMe tae ty sre Liil A phir mt PIS he Lbs overwrite LAPIS vf AS cAI gL abl peste ep tebe nS be eg the PU A Ag Lbasil A ey He geo Ie heated Sa iaa MLAS ef ee “tens? Soars "; >
    Output: test variable: She oSdostring hid Aik puter he Sethe de AUP eine WE Butler bi tsp fre tule rest WL pstestvariable Ut ferrorb Insert tS accesses ted me IS global Statement = DEL rhe eer AP accossthe PW ALA Ue OEE Le pai rect EL lly Ad ot No Default Access to Globals in Functions
    "; , myage 0) + > Output: My age is: CEES To) ane ea NS Uren te LEE Kept Z myagehb Func tl sageoic fututut eticy Sut direct access pL Git Mitoutput A Fine pol ce Af af overwnitenmslith bye le sat Au! LP CLS Hig bal FLL WTS tA Ph le Men ASL orl Seb UA Hee ZA Accessing Global variable in Functions
    "; ) Myage() >
    Output: My age is:42 tS accessH tabi sage the PA be Gg topal ie pt ei PLA AMZ access? ey thlie Me 2bLg Wy wile yl erp kye phot (,) aie Ew£ global global $varl, $var2, $var3 static Statement = Go al 2 wrunsinl Fc tek Nc try static statment wt JOEL ao Using the static Statement CT Gere aaa as Pde ES)
    $nun_of_calls"; y numberesxe () ; numbereExe () ; numbereExe () >
    ‘output 1 2 3 vite Hysstaticfiet£$num of caliswi&i(ktunctione ptOnumberExeL A FLA te Le hh P hte increnent#Rpstarioe; Aik gob oF eesti yeh S statict ie Gob SUpstaticMtaty, we calls Bri tbdydieystaric eke assionfds om eet le S66 be 1,1 Sarrrdo dig he toS skipAnteig (.ArgumentsL7) « Gia glwargumentsL mtr Aye hic arguments Pay kia el Cerror Guia aut Fifunsivargument GE PAA (optional yaa! Ufer. ror bi Ger in rgumentsahyeArgument sUAPLGtLy BL geikddetault foptional argument he Weide default ihe» eile (ond) (Ay optional Argument Stxt"; } headingWrap("Book title", 1); headingWrap("Chapter title", 2); headingWrap("Section heading") ; >
    output:Book title Chapter title Section heading yo REL Se Y argumentig up esL arguments» ule POG L Rut Teg! (optional UPI e Ue Unbide fault HL ARs headingMargument Sab IL dh VtargumentL§sizentgl cal sip AAV etargument eebuyissized ie S1,2,3... teurtagLarmnL A bosS assign eke oar shih pe ee pe Mii Fes, 2,3... fori dot Le stag Lsna> vise ut US i kept Ce tL BI Fbdetau ltd ML 1 errorbe ute AUF argumentL£ $size be tagh "Lahore" , "pwr's>" Peshawar" ,""isb"+>"Islamabad’) ; $cities["rwp"] print $citied"pwr"]; output: Peshawar associative lye U%eLytshort (PUI LE CAL AS dette! Sebi teh Ug ode blir h eet b aS yarcay Scities = Rawalpindi"; hth Bsc Le eh AS AE Ae Le tcitids #£fUevector array Sys\lcr fic Git ysiC par vlarray EVE oe ef Welements pUutvector Array uf associative array “/UbPuP Bu torr thie dd ual elements Zid nZ/ definee MC tle tr Lidatatype ExU PA Unttc if 100 double-precision floating-point numbers ff double my_array[100]; // This is C, not PHP! aT Poereed) owen ty) (eo Sod tl merbegvector arrays Sar svhL fea Setividatatype lft tihpe Pett access ¥ array < Block oLFecA KU tet compiler ML EL AG Ut starting farray iG rf ew Ere dewl TF slot SLarray SHO! Oe AiG L er idirect yA ttle 5,67 index shld elements Meu! See ial bau Aid ferement Wut Le plassociative Sy papgt S Sixt Atifidatatype f elements UU“Le daslot yiipnpitl Sew element gindex & Lo MA Sug Lartype-looseness CAS yeu « zylPne- fen? MySQ Uleunetvector array-fXSedouble ye #7 fetring 42 reinteger (Leb gd Pit index Zit Lau Ut(numerical order elements intro i tig Hiytenr te Cnt inceger t+ mpl Uerieya tli Gur a Sta Vout UCL Wee fib iti $my_array{1] = 1; $my_array{"orange"] = 2; Smy_array[3] = 3; G, orange, 3 key Dtizs(1, 2, 3)ufelement sufi & associative array Ly we ho OL Pe Me Multidimensional Arrays = usPelements Le poL Uuitiple tors Selement bee sbyl AL FrFarray slflobject Arrays array ( "name" => "Shakeel Muhammad", "designation" => "Web Developer ", "age" => 28, "skills" => "PHP, MySOL,HIML, Javascript ,AJAX,Flash " » "employee2" >= array ( "name" => "Majid Ali", "designation" => "Web Designex", "age" => 27, "skills" => "Photoshop Dreamweaver ,CSS,HTML " “employee3" => array ( "name" => "Arsalan Mamon", "designation" => "Database Administratr", “age” => 32, "skills "oracle" ) : print § employees ["employee1" ] ["designation"] ; > output: Web Developer ypdlefiteterenentss Bi teufoe bie fle ptLsemployees LAE! Licey! Semployees Pee esi LigAiyute slsemployees Uleed ALE Uibitfuntl access sf employee] HLA /\Semployees tkIL Seyelement mnt Mole sedan IdesignationLZlec ying aT Poe) SOP) (foreach loop) (62/U%'y! # pi LiF ule & WMedo.while sifor,wnile ery Sox wk Leu fe yi ene teil Ao keysterenents Less par reset 2 Ant (foreach) jE MLR LES ie LO te ie er Eb LAr it stor lL A Vivi) \n"; Output: Saturday ‘Sunday Monday ‘Tuseday Wednesday ‘Thursday Friday LA toreach fete A ib EPL ik estore the pg Sap Rutz SPvuinkeys slelements fassociative array fiix -< ty foreach foreach ( $array as $temp ) { Me } 4p Sis element 2 ys Listemp BZ vO tL i sisarray tery tA liane bt AMe i bL associative array Lidtkeys A/G Le foreach ( Sarray as $key => $value ) { Me , em maaan SURAT ES) Felenent Lisvalue 4 Le pUiskeyund pti fut CLI suisarrayu) ei tesp Lee tify \n"; yp Ususvaluewskey Ke A y > output: Saturday Sunday Monday Tuseday Wednesday Thursday Friday wikeysL£ associative array fife UKs foreachs ykeohe Joubes -ud APousvelements "Sunday", "mon" => “Monday” , Tuseday", “wed” => "Wednesday", “thu” => "Thursday", "Eni" => "Friday" ); foreach ($days as $short => $fullname)( Print §short . "=". $fullname . "\n"; ? > Output: sat = Saturday sun = Sunday Monday tue = Tuseday wed = Wednesday thu = Thursday fri = Friday ee ee SOLS) U*curtshort Lut yi Se associative array HuleSut eukne tutu LAP Aiitreys Ut eysSshort eeylefilte Lsdaysh fle ey toreach-ut mele thinned Medsi*element & $fullname Aut t6—/tMultidimensional Array = phil bl toreach bef Mike a AL SUL 6, tual tidimensional Array Sep Util Arrays</TITLES> </HEAD> <BODY> <?php Semployees = array (array ( "name" => "Shakeel Muhammad", "designation" => "Web Developer", "age" => 28, "skills" => "PHP, MySQL, HTML, Javascript AJAX, Flash " , array ( "name" => "Majid Ali", "designation" => "Web Designer", "age" => 27, "skills" => "Photoshop, Dreamweaver ,CSS,HTML " , array ( "name" => "Arsalan Manon", “designation” => "Database Administratr ", "age" => 32, "skills" => "Oracle" ) foreach ( $employees as $employee ) { print "<p>"; foreach ( Semployee as $key => $final_val) { print "Skey: $final_val<br />"; } print "</p>"; y > </BODY></HTML> Poe) Outpui name: Shakeel Muhammad designation: Web Developer age: 28 skills: PHP, MySQL, HTML, Javascript, AJAX, Flash name: Majid Ali designation; Web Designer age: 27 skills: Photoshop, Dreamweaver CSS, HTML name; Arsalan Mamon designation: Database Administratr age: 32 skills: Oracle outta de Pee ueduiefizelenent uf bie siefiet£ Semployees b# Ute Hite ssemployees wile AEE 00,1, 2 2b Aiea Ebene foreach ( $employees as $employee ) JU ye-ufielement 4 Ue Sete iA tSemployee f element Leylsemployees A Ute Bite sSemployee AU eye Gute gifitsemployee ie foreach ( $employee as $key => $final_val ) Sik Agen SPousvelement whey £istkte associative array Lyfe siete dnsesfieirtsemployee ouley Si tel futyeute” Au be YB ‘Ajunszselements Pun? gzslelements ALne sel Pethyptalsesstructte sfibbnt Ae yp ubboolean se We sibie® foreach ( Semployees as Semployee ) { if (is_array (Semployee)) { foreach ( $employee as $key => $final_val ) { print "$key: $final_val<br />"; , Catal they. dey Pedy Em eusoxeys sloLements Levine Ute Aula pibifie ube eee tI S examined z! ’ print_r() . Aj <htmt> <head> <title>Testing the print_r() Function "Ali "designation" => "Manager", y array ( "name" => "Ahmed", "designation" => "Assistant", ) : print "
    ";
    print_x (Semployees) ;
    print "
    " > output: Array ( [0] => Array ( [name] => Ali [designation] => Manager ) [1] => array ( [name] => ahmed [designation] => Assistant ) te tcount() = tc tei elements segs $months = array("jan","feb","mar", "apr" ); print count ($months) ; output: 4 is_array() = Ute yptalsesstrucing fine th gir $months = array("jan","feb","mar", "apr" ) ; print is_array ($months) ; $str = "Hello world" ; print is array ($str); output: true false sizeof() = ater AS count () Hh in_array() = oige LGA Abelg< Hlarguments nS tle wer te EE LG oh Ut-etlypstalsecatruciorrd tl Aga iu pike ei largument $months = array("jan","feb","mar", "apr" ) ; print in_array ("jan",$months); output: true $months = array("jan","feb", "mar", "apr" ) ; print in_array ("may" ,$months) ; output: false PE Ca ra) Cen eT us array_merge() = Ue Vy siete $first = array("a", "b", "c"); $second = array (1,2,3); Sthird = array merge ( $first, $second ); foreach ( $third as $val ) { print "$val
    " ; ) array push() © Gre dmargunent bb Lhe tHE SEW elements LS Le neh wi Sate puyieS um epunteyifrelements wo Livigg 2 Guia ume Ue fii erenents SUPT e ete re yal elements Sfizst = array("a", "b", "o"); Stotal = array_push ($first,1,2,3); print "There are $total elements in \$first

    " ; foreach ( $first as $val ) { print "$val
    "; ) print "

    "; array_unshift() « eV elements KlALe pee tPeE AS array push Mle array shift() » Urner iAE SY element Klee Sary = array( "eM )a array_shift (Sary); foreach ( Sary as $val ) { print "$val
    " ; d output: bc array_pop () SE Kaur eto phet/Frelement t-et/P element fe Fle ns Lf assigniMystruit Hull fie element 1k pRrespherry L AUIE $stack = array("orange", "banana", "apple", "raspberry" ); $fruit = array_pop ($stack); print_x ($stack) ; Output: Array ¢ [0] => orange [1] => banana [2] => apple sort () Jt< tf sort ytascending order SelenentsLeghy $an_array = array ("x", "a", "£", "c"); sort ( $an_array ); foreach ( San_array as $var ) ( print “$var
    " ; ) ete rsort () DACIMLAS descending order asort () associative array \ Ut-5, "second" =>2, "third" =>1); asort ( $first ); foreach ( $first as $key => $val ) { print "Skey = $val
    ee ee FOLIC) CSO Can) owen ent RT se) ksort() m keys associative array” tet’ sortutascending order GA >5,"al=>2, $first = array (" ksort( $first ); foreach ( $first as $key => $val ) { print "Skey = §val
    "; =>); } output: a=2 £ 1 x=5 array_sun() Re tiypssumbiel er $a = array(2, 4, 6, 8); echo “sum(a) =". array_sum($a) . "\n"; $b = array("a" => 1.2, => 2.3, echo "sum(b) =". array_sum($b) . "\n"; output sum(a) sum (b) array key exists() m (Pie tp falsesstructetr key eee key SOute hTe the $search_array = array('first' => 1, ‘second’ => 4); if (array_key exists('first', $search_array)) { echo "The 'first' key is in the array"; } 899009005000 emma ea Lia Ms see BR OS ay lh Seg Sey Ie ole gale ariel, Pinete Js postals_cardtuuifergethcl Ate die beartro dE ei pee BEugemara ty bicalglen£ ane UE LI Un Set 10 dite Ainge Writ Sneed” viti82$_ SERVER = Leena bnew We ise URAC te yl —UtLc element abi Filf terpitroeh hth Suih- dng Site 1h #source/listing1.php bhetuite SFE action LeornFutin $_SERVER('PHP_SELF!] mete erie wal Mozilla/4.6 ~(X11;T;binux2.2.| Ae bkuiiie uy £ of |¢_ seRVERT HTTP_USER_AGENT") 6-15apmac ppc) “ct Ajee 156.152.55.35 et MiAAtrpKetw | smrver['REMOTE_ADDR'] Post name=khan address=unknown, fecetwedirequest & Post eteiiesv querystring ]$_ SERVER [ ‘REQUEST_METHOD’ ] Is_SERVER[ "QUERY_STRING" ] fphpbook/source/Listing10.1.php? name=khan Udquerystring surl ae ti} iS_SERVER[ 'REQUEST_URI"] http: //p24.corrosive. co.uk/ref.htm Sfrequest ednGu $_SHRVER[‘HTTP_REFERER' ] Ciena) Coren Tt CT RTT TS wh Au S% (tL server_array.php Mt APSA Uke s_ SERVER] eb LYLE EE $_SERVER array
    $value ) { print "\$_SERVER[\"Skey\"] == Svalue
    " ; } 2
    po bgidevisérs / Liha ed pte face ual dive aes LE Fuse Liftauery string A Littl be wwe he LIM Ge uy opine Se aA ek See Li eb iit wie Lee heel Ji pig eo 2b A tifa tay LS Po GL gee Puce Enpinlic GEES ¥ ne So JeriJavaseript WE Rute rt tr ELSE PRs bn brn Moe iale br Sr Atte, L ob oe JE pea SPL ue AL oie L BOL ile recpidice re arin eh he bre Pobltit ELEMENTS< 7 online fairl felcontrol melements £pbAL ms eas MLL)
    tA twit helements 47H 6L¥
    ust Be eb tiL PA IA TEER Py fe yh sh) CeomeT ema SS ~u2/b%x tL form_textbox.ntml Uthtdocs (6. Letktext box Forms Who is your Favorite author?

    Lorms sphpethtdocs GULL bev pap iekle hf BL po) eet A Forms</titie></head> <body> your favorite author is: ‘<?php echo $_GET[*Author’ J; > </body> </html> Spl sintep: //locathost/form_textbox.html uf/address ¢ Ut W54 ¢l they EMosle tr er GL coms.php pOige Mitel HA trextbox dob fey niu et die Lrivcet tegplactionL pbb Age Pin$ Pods au febtes cer @L tors php-Si 1 taverystring $1 fan ptle trp ROE AL Unti tule th ope Ute dee ihiebiey Ue As_cer[ author") teal sf auchor sty text box Vit A ob Pie # elements AL pigs, Se tiMotrt LL eee ea pauthor Let tere mite te nie THL Pod HE opt ORT Felement sii comida MLS LAP oievilesyls post] ie Post Ale ys_cerl] ie WU IGETuRaction unerrtace/ element ute Ee iL AEC Mee pttg etailh < Lecase-sensitive Umut Mosute stunt ageute tel Sod fst fhwytiharps vostg.6S cetutu bu OL gs ‘Text Areas LPL Nrw rextarea Ew ttle Lu ntext boxwIoe veh Jeet Leif cols trons Mie uk Ald textarea <textarea cols=30 rows=8 name="txt"></textarea> Wer Sixt E re 30S herd Su Fie tutptOalhtextarealiL a Leextarea hemo pl AUeW textarea tlt bp Agee gieiglx Aaa pt a oe <head><title></titler</head> What are your favorite web sites? <textarea name="WebSites" cole="50" rows=' http: // gi ita: =| : htts:// netp:// ‘</textarea><br> http: if a <input type="submit" value="Submit"> </form></body></h tal> ~L/o%— tL textarea. php Sx} ZB <ttnt> <head><title> Your favorite web sites are: ‘Class-11(Page:6) erent ET eT TS wfisltextarea fipi-< LW Poste AUK < ends we Sey Chine Wie y¢_post¢ELphpd cat ‘CheckBox PS Ae -tef checkbox ttype Rutt UE IL input PLLA Ate J Lob uBpbdefault FL GE AB BPs Ake Jie bet a Pd A ichecked Do you agree with us ? ‘

    oa pt checkbox. php vip ben ae Sains Pong LEE on GL Ty Se LL AG AG tA ttf checkbox. html CCU ag) Coren Te OT eT TS LAGNA IDEA tee SSSA Bite bef A ge poLassiont bid Mitte rit, Senul ie Bol inure S AGA on Glristamabad da Kiln But Le, S19 A Lobia Li Sen iO re pt sil to ALN, AL pike Gute Zutpise Forlag £ Gb sy AGS Sl gel fo One tyete gti eng, -w/e¥= pt Lmultichk php (8 teh i£($_POST['post') ( Higetting checkboxs array $chk = §_POST["chk']; /feount items in array Print "Number of CheckBoxs Seleted=" . count ($chk) . "
    "; Print "You visited the following cities:
    " ; //looping in array foreach (Schk as $value) { print $value . "
    "; n >

    Select the Cities you have visited:

    Islamabad:
    Karachi:
    Lahore:
    Quetta:
    'sLamabad">
    LE) end Lee bpti Live lege WAG til Ste hing but Ceara) Coren Te ET PTS (Mele le ee Sinidden Kite Se Buupiie Very ut bruSersikk (i£($_POsTE'pest']) eRe yegL pce eee SAILOR PABLb IF corm $y be uta 6 pa 21 nui ds Sin idden? PISA SF Aste SoM L1s_PosT sles epi FILER Yt ev-Gerror di Siriadeni£ Lf submit wL£ LS serect AG te Liyerror SIL LS ero tie pup SL at rue HIE ite eV sie SE grt rue Radio Button fh Ble y2 LAL Se Sok E Mut AB td nt SAGAS BE Lee option VfL As tRadio buttons Bur ©O Purbradiotextltypeft Zit

    Gender:

    Male: pizL nd OL re Le RIGA te Be le Ben PSEU pI Be ee Whidden Ley Liner Mee OAS he BLinputst, 1e"> female"> ‘female"> if male">
    female">
    wt itil Sos tothe he CoC A Uh" Ee FI Ute bio Hig AP ke REM vids fi tifusa tern Lvalued th eS PIL iy Kes, List Boxes LW TA EE Ei tense Gut er Lih rut Ave ety ui et Kite tai WL seh Sie Lie te Lilt Eni t rie Pakistan ~ " Pept ELLOS option SMALL hI IIL ITA fidl Blue Avhite ape O ELA Wi Hinbin LAS" AG ite Mien ~ffi%aptE listbox. ntmviy 1(Page:10) (i chead>

    Select Your Country:

    Select your Favorites colors:
    LALA Ber Fie Si Le pt£1i stbox.php—! listbox " . §country . "
    " ; print "Your favorites colors are"; foreach ($fav_Colors as $color) { print "" . Scolor . " "; + > PhS Pe ALL colors sy oh fe HL country fli stbox. html y! SPA Sel tie Whe whl fda AG ete ew le Se ot Litemte tre Geib fi, tdetuale Fest dite ppiCvalue ut$Loption Stassigntal(tcoption sf items L ASU tuespiL~ leet Syl label for eee UT Ce) Cowen Te CT RTT TS Ure fib tL >Iran 1H" >China wLpakistan AG EY item. dn Meade optionuteun treba tent Set &S assign ibe wil paki stan eSn bree Mie eet LS Buf selected tL iB hidden PigBe pre BL bh to PUL winger ee tnt ASLO Sshiddenut type MUR uta TE Pde Ur tee eet YriLLes boa tue if BESO PUL Ler Ase Sb be 4 fs dept Grint te UES oleh et SSL HUAPUL I AS ih FL ne AS Line GL Puget password fut ype He Be Fcinput> els eeeeee eae) examen MEGS (submit,reset hese eUUCHEN Reset kL Vee rE Ltn eo bes submit button ew LL Letty Lee set tibtieaes eb reser ae Pue ie etd Bi PLL EG ipl SA nt ppl url resetutenfltype Eee ees Py LS poly tote Puc ee i! a Form ar Web Developer Required

    Please Fill the following form to apply for this job
    Name: Cian UCLA )) erent ET eT TNS -U-4s% tL application. php {Ubu application. php (& $value) { $value = cleanStr($value) ; if(empty(Svalue)) { print "" . ucwords ($key) . " must not be empty. Plase Click the browser back button and correct it. return false; y ) return true; ) /fcalling function to check any empty value if(lemptyFields($ POST)) { exit(); ) Jf check required skills and age function isEligible($skills,$age) { $age = intval (Sage) ; i€(count($skills) == 0) { print("You dont have any skill"); return false; em ee LSS if(Sage < 23 || Sage > 35)¢ print ("Your age must be between 23 and 35"); return false; } return true; ) J/assigning fields values to variables Sname = cleanStr($_POST['name']) ; Sphone = cleanstr(§_Post[ 'phone']) Semail = cleanStr($_POST['email']); Saddress = cleanStr($_POST['address']); Sgender = § POST['gender'] ; Scity = § POST['city']; Sage (int) cleanStr($_POST['age']) ; Skills = § POST['skills']; Wealling faction to check J/that the candidate is eligiable for applying to this job 4f(1isEligible($ skills, Sage)) { exit); ? (/4£ every things is print "

    Thank your ". $name " for you intrest in this job. We will contact you soon."; print "We recived the following information about you.
    "; J/printing user submited information print "Name: ".. name . "
    "; Print "Phone: ". $phone . "
    print "Email: " . §email . "
    Print "Address: ". §address . "
    "; print "Gender". §gender . "
    "; print "City: ". Scity . "
    ": print "Age: ". Sage . "
    " print "Your Skill foreach($skills as $value) ( print $value .","; , > Site rniba ile get ¥ validation td JM Wwalidation AL Pepi GaP End PpsL validation tke Rut ids Sook ater nut ean ves Ere erT J Seema MAGLI © 0 HAG SPeol\eS4- p=Kas fy -2* Web Developer Required Please Fill the following forma to apply for this job: Name: Phone Email [ ‘Address: | (Gender. Male: © Female: O City: [lelemobad © ‘Age: ‘Skits EPO e oa Poses a Javascript: (1 [ajo MysQu:O (Ge) Bea) i hitp:f/locathost/application. php - Microsoft Internet Explorer Fie ER View Favattes Tools Heb 7 O=«-O- BAG P= tom O 2-S EF Bah DS Address |i} hetpilecabostjappc ation. php > Ee Thank your Shakeel for you intrest in this job. We will contact you soon. ‘We recive the following information about you. Name: Shakeel Phone: 5555555 Ema shakeel59%@gmail com Address: sdf sdf sdf Gender male City: Islamabad Age: 27 ‘Skils: PHP HTML Photoshop Javascript, Ajax MySQL, Coreen m mm as OLS She teVenptyrields LAYS yc yp Lite 2o aie AS string big’ Tcieanser eS name site Mina SEAL ie cu Liga OOo tesIs_post pre ney eh taarabasee Mn te bth Me LRG Aiptohe cilia bled Pie LT. he By ts Se ite ASE oto te nl tliat! Bp SEABG tng RE i ESE SOG ML ALES ABIL ite en tite f de Sit Lgl Sb ity ial Mate nf@ ke eo 1n0ine Lise Ste WJeWiseriginied AP d.6 pbetilne SAUL WEL este OFA Ferg ec giLitte skitist) ptOnuti A Guth Visage slsskil1s-¢@arguments bl Agolte biM be ifite mL Ae $_post[ skills") Uey$ski lls Sard Lge uh count LI ivemsLepupte te Bout abe OWL wee trot elements te suns Gua OL ye Se lr skilis wfhitt lL Bille SAL wiAtiielsage-L AGE applicatinuPeeut (guaFt Avia Uesslhytfe Ube eA cmbic Jh35 falofe 234 See Me wR Ie A Kouttywib we Cys post El dpd nolnL 35 sla ff West SP ier es eerie Legs heist ERE ALG EL Le itd aU eM AF ale Gp IPR GF Te PP exit() BE be Ue re pUplet-ct/PY executions, Atte Wiriexit Ae oiLaedeut tot Pexecuter, fam ole ANC Ante pnt phe sLiewiiht Bute ek Chee exit ("Your email is invalid"); exit) Buble Le OAS oni tM ng 8 aie Me Lh SUAS exit Mrpup iy ru flaiey cbt die ("Your phone number is invalid’ BEML Ed AUsbe-Untrbe sol OPEL kek Te STOEL Unt et ob sare pub shakeel899@gmail.com Sooseoooso—e Creer) over 19 24 PHP, MySQL 0000000 ‘sibel 9 co00000 eel tebe ted ye Set Je iElementL¥6_1$_SERVERL Le AIP” a) at Pott te AL iit” ULE te Heitiuinetine iC request get & SUL AEE eBdievtexit LiKE 22 phat Spee ‘eth JGe HTTP Request /elements2 Leb 2 Chloe Se SAGuityL See winseeen Labs ” Oteale or ete SAL AL EB Hiddendy kr fink Large eA euinw ext? teilsHidden Feb Jee HTTP Request /ilHidden ir Grutids SiBHidden ir we PY tle WAPHPL uturtLelementvitiour [chkDel] :r chkDel : 1 chkDel[samevalue]:" chkDell] : PAPE Une tek np LG Ae Bes ealculator fi :3 yt pst Lee bres WL pig hth Sec Ei fe St LL pity pe erorsiL —Tipiksuble Aecpiseuig ie t/ Fie validation LP Prt h Ge Klett sige igh Leaf Ale SA He oy oh pte pa tybe Meum ie GALLS TEABS display CL ole eh Seeuit LSA GTI 7 Ori i740 dT ona maa LS Tk oe IS al SF Eceglagd nay apt Se al aaa gt (Regular Expressions) 3h, Pi regent YG bteR ire the fei okk & ABs» Walter Pitt 49! Warren McCulloch Ut G'= = UL x pL UL Stephen KleenealeLf Lt 1956- Wok PBL Ue Gert LE Ate SLY Bot be FEE AL Pt ge Life fal Ct tale Loar fF NL viv tL Fr Be BELL AAU EL vii “Representation of Events in Nerve Nets” fies -"The algebra of regular sets” wr net HAL Ue VIL (GWUNIX)Ken Thompson kd Vs Wir EI tate ee “Bqedet 282 ILCUNIXL IE ee, a Palle nfl rue SEL LE ntti ea fil SEES ieee Le Rb We Pander Led Wee Bed Bovey weer etree inirh pee eb Sahind wtas x LP otittrbic Gul & SL Sieh het Bevo Ee i festr_replacesstrstr SFU L et ine Se SELL Een 2 bg she PGS? exact SEE Lo th ee es A srble ene gremaile Liighic te tre rb SSCHTML ALG et Mo thgaF sie oo Serintelligon IS fer tied drool snt>zek ete AAC PPHPe Be Brent 4: Perl Compatible Regular Expressions (PCREs) 2: POSIX Regular Expression eve tht Lice slower. At Prbeteg th Binns Babulien, KL Utz FEEL PORES yt AL Elie ne Ph wl Uren ete Cara) erent ET eT TTS SE Nie BP TE ge ty APORE LUI nl el oye Lute 4: preg_match () 2: preg_replace(); 3: preg_match_all(); 4: preg_split(); 5: preg_grep(}; 6: preg_quote(); 7; preg_replace_callback(); preg_match() fre by onhle th Aine tte hy re ur acai Mohit hss ep SLi Ahr Ponhith inte arbi te ALUM WIL t UTA EBL bo BG CPL ALE UL LUiipreg_mateh()*"" PHP! Pores L JG y nlf $result = preg _match($pattern, $subject, $matches) ; (ebb ei Re tn rb tic WEL fie WY Sargumently Au eth. Bib Mle eI gl fargument dante = hire Bs sotruedn 6 bie Jautien Se sargumentZ eonre tale, Grab e Soap Thole pteteg$ Ite Ch Arve Lip ie thy false tut Metacharacters UE er BA Tbe AL A ter IP AWPU VAL EAL, PHT OCA Sh Cr HSE 2005 [1] => 20 [2] => 05 ) ee ee POLIS) Gpeutints ii Le Wie pile ta Py Be Gey 0 et Hyer Tae, ff woman AG SEE man git * (wo) aman" oe wpAde Lush 6 PEC at i RSI tO ee UAH tL reaxp html thtdocs Sif tiawLuS validate f regxp.html regxp

    Phone:
    Email:
    address:
    Gender:Male i Fenale:
    Skills PHP checkbox" name="skills[]" value="PHP">
    HTME:
    Photoshop:
    Ajax:
    MySQL:
    anbsp;
    NIC #:
    Emadl: Please provide valid email son0ex-200cI-x
    Mobile; 222-2222222
    enbsp; énbsp ;
    en /> Caro) erent ET eT TS regxp.Php " ; Felse{ echo "Your email is invalid
    " ; , Af (preg_match ("/*\d{5}-\d{7}-\d8/" ,$nic)) { echo "Your NIC # is validcbr>" ; yelse{ echo "Your NIC # is invalidebr>" ; , Af (preg_match ("/*\a(3,4)-\a(7}$/" ,$mobile)) ( echo "Your mobile is valid
    " ; Jelse( echo "Your mobile is invalid«br: 1 Beil As Bul Areaxp phpe Puts Bote Wecpb OL AL regxp.htm! exudes Sete JAY ele validates preg_matet/fic sit AME tA BE ealg ut preg_match ("/*[*@ ]+@ (48 ]+\.[*@\. ]+$/" ,$email) shakee1599@gmail.com ‘JefEvlewfi tahoe (in the beginning of the string »/@uztsAL f+ “ BE OAL KLEE @L i ELE re GIG ogee Kibet Shgrhe Creede Als ESI” nie { repeated Ate + cere (GY shakeel599= Ks fear eee AGT Cea) Cn TS pce HE ye SRUrGL shakec1599@ -eewEr @ Sr KI I@eirte nw L@reunks 1°01 br BE shakee1 599g Ula br Ege < r@ Li ghee (repeatainst LANL TH Se bbe ASIA + ec AW L ie Mle ern KE WRVH EL shakee1599@gmai UUWh ie pig ere fikace ute AAiisle th fact HA Kuh \. te SIL dot tiie bere Y escapee JUGS dot MBE Poth 0 ee URE bone SPL AU ~fbnGFshakee1599¢gmail. UkUWheU*brdot shakeel599@gmail.c KUibke PU @L tHe TEL Me] Lb EL €2_bx Gf shakeel599@gmail.com.<|xrepeat {MS te Ty + nee et $ PO PAWL we NEA BLS validatedeS us HSE CAM OL AT se uig STG SAL KS Ofer BUI bio SL bial Lye false”? @gmail.com thse thy tURU! We shakeel599ggmailcom Poet L@ CEU oe @@gmail@com Bn QUH@ solibe te shakeel 599@gmail .com Be See eb Le Ll KU! oe shakeel599.gmail@com Pini yiry $G@ * shakeel599@.gmailcom Bin Sey LF dot x shakeel599@. (eLsclscet@ domain tx Se enllh validates iy Ura eS hie phot Muléle wl Le tk Te pol EOI re tt WL Grier Strole fotze ema aaa ass he IAL eu ihAt /*\A(5} -\d{7}-NdS/ Arch tnEigL nil. de_25654-2265485-7 ie tee pene Feit Yel etge ety e th AL tol ite niet SELLY * -Ebbwrrabs Re digit hh \d{5} Ath - -Exdigitsel4 — \dt7) bc fies 2 ~brdigit A \a (Coney $ Modifiers SPELL Ly ith nL AL PEP EE Ute fe @ be It ELC wld AAS pcRE Inte modi fier 2 Nazi/i Bronk znla 2Q/EASS /ta-z/ Bie tokcase-insensitive G4 rE asia2 Ee modifiers went tsiLoypi Sute. (m) Be SELL AS > Se pe ete pty Lanchors (* §) modifier y 65% eb Leet modi fier HU tlk Lit er Lieb RAIL uy” § SCE FAFL AGS sh CFL AL Ai Cea s Gere pea as Eden GES) $stx = "ABC\nDEF\nGHI" ; preg match ('/*DEF/', $str, $matches1) ; preg_match ('/*DEF/m', $str, $matches2) ; print_xr (§matches1); print_r ($matches2); outputs array ( ) Array ( [0] => DEF ) eeu bss vince say Ayo ttre teute APIS IE DEF A tude dP ATS ia VU mL Autuseyn Vite be mute est eG Fle srr pls fe Ele PEST (s) el Grrrl ACLS dot SG b4d Aue Apert ALHLM . elbmoditier, LES AELS dot An ez modifier $str = "ABC\nDEF\nGHI" ; preg_match ('/BC.DE/', Sstr, §matches1); pregmatch ('/aC.DE/s', $str, $matches2); print_r (Smatches1) ; print _r ($matches2) ; outputs array ( ) array to) => Bc DE ) Liew SFUP LLU EWES oc le hh yee Putte Bre ee pr Bln Toe Lee esnnE le gi iec B-1/ ES DEAL AG abr Bu Fag ELSASALN = Pe UWA st ifr ated fut Ta ee MySQ (x) Pig Dei Srtnbies ik pWOL IW te fang Brtrmoditier ,/i Sstr = “ABC\nDEF\nGHI" ; preg match ('/A B C/', $str, $matches1); preg match ('/A B C/x", $str, Smatches2); print_r (matches!) ; print_r (Smatches2) ; outputs: Array ( ) Array ¢ [0] => ABC ) Fh Pe WU xd Pte pre em PERL SHE A te Ste hing VrGotevltl Pe, (e) mack Jeeymodifier gle erst PIL preg_replace 0) Sfmodifier y tf evaluate ¢#L code £ pup (Ey replacement Avie world wubtutreference Lutite KL preg_replaceLpevie preg _replace( ) Site t(search and replace Wb tryin Le RAE AL el AfrYel yplerb string fre tbc 0 preg_maten() ety lU diy he tia preg_xreplace (Spattern, $xeplacement , $subject) EAE argunent Ene NL nL AL re WA LUA Slargumment ty eSiutsreplacenent LAM hyp brhnd npr tic ab nt itie, Hie Seer gE Arif back reference sfite Fatie Voxel Sut eE\L, \\2, \\3---f Pte assign fback refernces LL/S ILLES (aEeem ae) nen Te) arr eT] PHP,MyS f: be rs UeSE ure S appiy jot A Aree Fide Lurrepeat sinbit Hite wl Ele Ue eke Ui \ sh Atul wht Sete = ‘Hello World .'; Sete = preg replace ("/\s\s+/', ' ', $stx); echo $str; output: Hello Wrold. ~einJiWback reference Mike ALLL cho cb> REUSE $str = "We love Pakistan" ; Spattren = */(<) ({BB]) ([7>]*>) S$str = preg_replace ($pattren, " print $str; wee My tl otra kt bev spattern Ac be fii Hebd Ate < Sebati KL Ae NL \2) 03 Abe Patel toe ht E> Eire HIS HE Se ME fre E/E Bh Se KO ep EF EBLE Chix p> iE <> > Eig A CULL Lv enassign/ \2,\\3 Yb ve Zale el eibLbrassign f\\ ekg CAS \ 2A be oe Lote Kore Pe II \\ 1 LG IN\3 MEE be thie Auteid nie ¢ ble hate teMopy pearl Bo bnbetcni> Lt cpt pit bob muboe Pute HUY "a SPL othe fe AL UA GL regular expressions Ly heey BE ocr pibE bye I Reno aL nition L PoREL ee tbe TU ERT Cte be PAI CASE Le oe EL Ae i php neve oye VL RAUL EEL ee BAIT A Sut Be eal tsb ute tnd. '\\3"", $str); ld sas shakee!599@gmail.com seeeseoesoes Creator) ower 00000 GiL455 9 00000 19 241 PHP, MySQL ee L ie big A pec Sly fermi Cunbittnr ai LE Eitrbic nin GA Gar wate ie Lue LEAL fuld 2 & fetal AAU Sttoe tii: > EYAL a4! y%e"Hello World ffiytauk + 5 setuJe*! modifier WAL t, case-insencitivey ay” + 1 SotmeI2U~ modifier(s) : 3 sure back references = Ebb tee Lab At ttre BOT bb 22 pg RL ASSO ALL THES validate (Do-wm-vyy) (15-07-198) ie evi Ae tg Whe Hb Leniuine bet defi ihe Fon E if hep ig leks PL bb 28 ee lp LSeostegir Dunyag (Ate (b]--[/p] eS

    furmiste tf bold CA Shea Got Lb Sec pat LA pac CF ire PA Bei alot iS Gary i SP ee pio 5 WOE hel Sule Abt harm, ELE LS fu]... [/u)3 (41... [/41:2 [b]... [/b):1 EUG GIALLAecF miei1o [b) TPDunya[/b]" wrth tLe Hale Hello ITDunya eget rion linr HTML €\! Hello ITDunya (eth bat turntl sae ule preg replace bili bL nee ee) CESS Rt Co) oe es SBT BS te Sy tS Saal Cay ol US Bl a Bl state viSGid DreamweaverExcelMs WorWF.tuSalides ktopICUB ie tule = AM PD el Alt Lge Pot Seti Luk feeds Se Tee Me GI Lestat ehit Se Wein te ply eA Bei tN ig TAL LE SAW po tl bch tl LAR ey le BotetnpLegelae tebe Wil pill REIL Eval teu hae bet eines evipt lL Shr ty at IL Gen deny tt Abe stata Pehle id Pipi 5 BEL Lg tte I TPL ALA stateL pata RU g LE LANE LA SIA Bes HIG IL plas aly tHE 5 ede Livstate dere dite EE Gate stat l Hute Fgh taSall MOO pte eR Mee ROLL NEU tah gaS Lt Lien GIL ol EI FATTER communications GES Lb rhe lub le etcs EWS staterLorjecs lousy e Wipeifnrre LilegLnstateless Mh Peegbort L3G Qi eie Me wg itihca hereto Lee Mn phALE ujastare (bE KLEE ISL A Mee pf L OLS Tee tT RE pups Tobie Luke ten driKetonuizGuslt_/ request Gu hate bee wt lse te PV TAS ety ASG le Wate WAM Bay igut Len Pics PEM LOEW LPL te oR LEE LM Sater BLIL BRL ENS starenget Lyf lyfe dk Sate dui ut eiiaiiidaens! Sessions Cookies Query Stringat, Class-13(Page:2) COPAN YY) Te sell (cookies) //f 8 BS LR te few She Amer § cookiesuitehe Abt ten UA Mu ot GEE 6 Le Foo WP Qe NL iy LOLI WL 8 oa DL CML Li Feu SL nh Add Bug Loess site Beet PELL eA An Babbar i pM (he aS F leh Leg < Het Baye athe OP etn fy LEM etl Eb P bite ap baul WU netibagcun® Speen isiags” te ost hPL SUE PreferencarbtrLenyy” t Kean SL Pe access isle CPL AM Sk Greco Aa I ye yh Ss le cel Bearer Ai See Ke nerd ifieew eLetter ce et MOOG Lb Lt Se bola NE Ea 6S ee i aE tide ty ou cee let bred et we Dea PL eS eae rile EL We FPL Be OL PoP dn PMP EL yp bE ir fidele bap H te LAR were Daycare Mohr WS rg Sd MEE Gel te SIG eb £1 nore Hiffetw oye thy ytde e contents» limmny Se ut BIeew tieader Jute Leisd wow php. neti dle Se UI trite y elie the thutiieader nrc www itdunya. com YRC ueew Lt fH tere Harqunentss 2g LAUuriset cookie () Pv pape LES ~Uiflarguments CCST) COPAY Tony) PT ey setcookie ($name, $value, Sexpire) ; Seber bin P fla cqunentyt Bike SLi be (Gin Udy fy La rqumen tig Pil Bh o1 por /197 ore tate De ptm x SB et LE be ot Ptonix Leime (IZ LOA AL coonieh Apel Mee PE time () het Pte te BPuZ GS 36002 setcookie("mycookie", "somevalue", time () +3600) ; Mob SI Seba retl LL wnsomevaluedh Re Wmycookial fpthGul PAD ALIA SS fe Fret ke Pe abheLs_coorre [Leul Tenth Bee PAVE LEA ugs $cookievalue = §_COOKIE['mycookie']; WUlevmuts_posr wig cen Ate dex Seite Js_cooKre Sut Lew ALAR IG Pes _coontet) UANELAR ALAR EL bl Balls sy pes LS Sig nL Ee eel I Re len G tote Leu Le MINES (Pe Opvexpireatve PUe AIM texpirel fT setcookie("mycookie","", time ()-99999) ; WBA assigndbiHunge Arey setcookie ("mycookie") ; -LMHe tL cookies php M2 LE JEM S ena ana aaa ULL) "; print "Submitted Text Colo: $NewTextColor . "
    "; print $TxtColor . "
    "; 2 Cookies

    Select a new text color: BE he obo ruin uig bees Lng RR TAT Lan UES chk Lethe fotpasswora reid AgMvyAremenber waft PoP RUE) ecard 391 AMT (session) PUES Gbip-c bene cof toute DIL gh fin g eifeige® Fie hk it bo Pie ihe Pt SEE CELA yp ir DIL FL Usensitiveas ere bre Py Gel Ep EMOPAS SIL Lose Lie tL el pis Pn SE S92 session *ufesexkey Hie et Leib Se HM re th es fsession identifiex CGEM otra fe iiw fie iL identifier sessionS, AL Ae lie tet lire kr tefisto ue (session 1dsip GL AEL£ Pea AICI RIEL PLE po eV AL YL TSE Keele be E UPI Oe oP ety She FUR ty Dt BAS smote bhsr iy Sigage Uv Oe Prt aty S accessh Peek frule tr AEP Licayf edt Set pup sess De eA ete nthe RPMs Dry Asie tet ins TDL trequestMie ty Pattee te ble te die tip yh fe ae APE Ne tad ey s10 sro b gb ARP ele pb atoll AG AUC Ula iL ets IS Leth ctu wed city eepile AG by be Avice EAE AREA BIH SS oc GK AL WE std Ale trenabletr SUL Enkin t PL jd Starla erly the bute PUL ie sD Pe rb tibet tt IP oF L ed fds Pe te ep he Nee LE GES ime outs e the FP Lactivitied wil Pyvib Ale trrrdt PEEL A Bele yi tdunyar ated itdunyat te debts fot OS Lod icaunyde LAE RAEI ig te Di ty Soe tot, Ta ee MySQ OP eae ty ftolnd tle thnexpired 6 1% eS logouth tek STF Ee Pot ei ett L Le wii pel Tet Ln Ut ey eth tebe le-vilet! huthenticate ih, s_e to Lslusername APEABEL LN gp Hel Ln Pu te wie te Le toby redirect,SReS tl IPSec te OBE of nAnh Baesbba fatimeouty 6, Vise ty OG ce UE Se be oe Turn contents: panne of 42 AUbtisession_start ( PREG ee bolt wl PR hep Sortwarning iL essa Mies $i Me tyne Utics_sesston Pee te blk th ef pe i Anle thneae fills Us pt£sessionl. phpUbuL 2 Uy! Page 2'; // ox maybe pass along the session id, if needed echo '
    page 2'; > ELPA bree Fine Pe UA Weession start pKa Ute fingt Hundisabrestyh tie prute kul session ppg aly eyo® ~UJbBx session? php ipner tute E tur! iy 3(Page:8) "; echo $_SESSION[‘user"] . "
    "; echo §_SESSION['pwd'] . "
    "; echo date('¥ md H:i:s', § SESSION['time']); echo ‘
    Page 1'; > Pree sbhes session WE eee tive Me eee Ase EIS WIL AS AILS Hol AAS session! php ieLue Sey ibl Sober Loe TI En ihe PL yng Be poker ie EF Lge ae LP EF Php tie Fe UL UeriG session destroy (ELSE session_start(); session_destroy() Enaccessibieda ffl Lf iy std rae te sis_SEsston | 1% ft i tenui reload UR e-ut session_start (); $_SESSION['test'] = 5; session_destroy() ; print §_SESSION['test']; // prints 5 Pe assign WoLiMts imply Iet/ PS element yVL$_sessiont A session_start(); $_SESSION['test'] session_destroy(); $_SESSION=array () ; print $_SESSION['test']; // prints nothing. The test element is no more Class-13(Page:9) ener era NS (Query Strings Fr bul WIL Se th Be re CLE uh state Ah Pbne tt wralg AI Ll Stour, AMIE GAL Storrdeyp thot ele de Saath SL SB gh nbype wil tl http://www. itdunya.com/index.php?t=223 BEE idoie Ltunnficdfiezsuidkefie eS iufie-223 t0RL Set http: //www.example.com/page .php?name=abcéid=236 PLA Mil Basile Ue te fhe Bicuinamet yt fr btL vr LIS 016 AIL ee nna DU taR AL Aer thes cert] Uk 76 Hidden AF 4 geh Liha eel poy te ups starefe sL re bret sy Lurilen paisiluu Ee fy Ue trentfie BEL ts BL bauer A se bt Be pt£ loginuthtdocs Lb wb Lieto ~LFEP IL logine ptLuser_login.php MU biz.0 pb Wade yt usex_login. php ei my Class-13(Page:10) Coren e ET eT TS
    " ; print "Username or password is not correct, try again." ; print "" ; oe >
    ittp: j/locahost/loginfuser_login.php User: /> Password: << Login >> CO Remember me Sem meas ALLS) Abe tL checkuser php UuWIL login dM bier! A Admin area

    Weleome to control panel

    Logout Address |B) http://localhost login/my_cp.php Welcome shakeel to control panel Logout 76% tL logout php AAsLioginSyuwEs al http://localhost/login/user_login.php APIA tise ABET, LAGI AG Lremenber neg Pthinge le Subst iSite heE yf oxe/istaamin areag HLL Sys ecookieeel pit, dL fee tadmin area Tatke yt TLS PLL Meteora te redirect ELS tolwd Es bor bina Ae Lei PE eet ST EL my_cp.php Avie eg Lie, GL checkuser.php sf logout emy_cp. php wheels Wu CAVE Tite tesa tlt, Cui Tiny SP ASL Prk VASE Loca lhost/login/my_ep.php Ped UA ud SL fering ih OIE Ginle Torr PHISLELLS redirect LAIST AU ait Pie thee abin tise rd fiycheckuser. php Aibg tidus Age Ltr pil Lad Avoe tts tor Ses fats ap Fp1222 22 thas bulitdunyagtiiz- eo Meh, ain Coeur Gere aaa as Ede ES) of neader QO pfitneader () AeA Liw rr gg itcheckuser. php #uhoutUeuiL. Meets Legepe a pfiyeih a SBb kL Ue pe headers 1s Pipehetteneie tee AG Cyt SANE pr tinne th ie Ute header fi wet e 1 Wneader ) LEE Cheater bs ed PEL A kcookie Any Whehiileree STK ee bine tke LAIN wie tli $F VF header LPHP IL EAI CIA Tbe Ze 8 warning Sitios LE Le HEI BY Ihe INL Dye ei Eh Si header itt UE Sie contents winter PS AL ELLE headersts Frocation: L fiuhut £ wneaders bes Lut et OY Lineader bi fut oi Sige Soe Bad Fore te UHI LS ceairect Ste YU ineader tet reaizect GL SFM ie MwA Ly bua & redirect header ("Location user_login.php2e=2"); Seontents dnd proxy Ltt gob Vib EAI Bneaders Moab£s -¢tkadisable-cachinga yt headersy_-T% cache header ("Cache-Control: no-cache, must-revalidate" ); header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); Mize UR save dialog WISE be Tote r2LS downloaded HigeTt ute sGLLS cownloadtipae tin TLUbULE Ue ineader w TiS save header (‘Content-type: application/pdf! ); header (‘Content-Disposition: attachment; filename="downloaded.pdf"' ) ; readfile('original.pdf'); git titrydneader_sent () cheader_ list () Yet A flotske iL are Sh Usb rustle bes ibiel-uL dead php net ge veo Zfole EA Rel —— gb r050 LS * Hodnd nde teks shakeel599@gmail.com re Ses VoOKAGEGIoOe Coit P eT as aT Bp ts HT apt pm Fenty 9S ay gh Se oles Bald ‘vequire.linclude a oicontentse pre, 6 PHP ser tumiyia PUT Ue tetiie liu re ult aiheadererh E tiut E20 Se WY aun Je tute bun Kerfiigt BL An Sb Ah ay oF 200 Tinh au i tneader ie trfooter Set Lut pal ee (ON Mage Cat see J A Sunibag he en l el t nun rere ough Ntetethete feud é duscraSe header , footer ¥ Ae hese IAs path ie Wargument i? included -< G26 hry SMA WBouny include ("header . php") ; IG UUG, PA trequire () Se CG AGARL HEU AS Liirequire () slinelude () ES executions, include () Be thestop sunt; Ure Wud executions yee ptL inc. php Fite NEG se warning Atl 1p fee ptL include php fiz. 1 include ee ees POLLS) ex Hinclude .phpyute/Gzutinc. php. fee sluch iwtE Lief include .php 6 et-# ¥ include. php ¥plarr ie LULU include.pnpL Af inc.pap i 6L ex WL site Ef wllifie ptl sitethtdocs-L uf template Hee ae tincIMb ee L ottiincudestifuWksub folder fie pt£_ine -uF savee ptLheader .php header. php
    My Site
    ~pAe%e tL tooter paptay£ ancl es footer.php
    scopy; Copyright 2009
    My Site
    -US savee pt left phput_inc/Uw&t left .php
    Link 1
    #">Link 2
    #">Link 3
    Link 4
    USF A ince pt£ right. php. right .php Right Contents
    Cats) ena maa LS UL Sb pt£ index php tudldsitesin index.php My Site
    Main Contents
    <®php include "_inc/footer.php" ?>
    text/html; charset=iso-8859-1" /> Ly Site ‘Main Contents Right Contents FREED © Copyright 2009 My Ste Coes owen Teter ry NS Bebe SE http://locahost/site/index.php Util CP Ue tia be Lee stew inte r£ n& nhetindex. php Fil dur suid hCSSBrtsensitiver UES wb iene pire Dt eyditine SLI TAM YS He prpit Aint/ include t Boy LT Bheitur sl contentsL Sus LY Ae ar/ LE aetpupatl Ape extensions 2 pLES include tthe, Fe 1d iL ELIE SE Rel S-< OL I» Sel Ae Mee hGNL Ly Tf Gvalidat ionM eg Aig Afi S Se LINC. pr SLRS bale Wal Aig ithe http://www. example. com/view.php?page=news .php Wiebe t pagel WE tig Istoronut(php. ini fou AG 4Eigatlow_url_topen/ Sevstrbefifnacker ¢ageoS include te Fue Kiohag ke sare Burge He CW LOL He MeL AL pl uriyinacker-t tes http: //www.example.com/view.php?page=http: //ww .hacker.com/badscript .php uit Pere ty when tects tray se AW REL We, Syne Z, yt Lehre ees allow_url_fopen’ nackinad img Minciudetie 2 UI ie Aen Atté "main.html", 2 => "news. html"); if ((S$index < 1) or ($index > 2)) Sindex = 1; > <@Welcome to my sitedr /> news -html.s! view. php?index=1-btUAUILY bl ttf include Smain html Agl Lut view.php?index-2 ena tna aaa MLS") require_once()sJinclude_once() -e-tysrincludesbul Si Lieyeoi} met includes Hig, Ae testi pa f includetuwbei et fas Vanda ogc Aiiren emule tm tye dts PEL nile tent sinliGtisinit@s includet Gt Ausioeavsiges MeL ie, Bute Ss 6 Put fipar = ut Lendeclare sbelipi (6 OAS require () Linclude () J 2 uf 28 285 require_once () |include_once () Buia SIMI GULS include su Meu, ee ut Lich Ly =#In include Bb ys Se isset() tote AL Ae byl op he ctiberei UtrArgettype(),settype(),intval(), doubleval(), empty(), strval() Luteo AL SUPPL eis Pare pte nbn te Lit 2 HUericophp >L fi floatval() Be thypsdbseloarvr Poepie ULL gt $var = '122.34343The'; $float_value_of_var = floatval ($var); echo $float_value_of_var; output: 122. 34343 empty() ostalsecatruckkorrdbitcey hte Snler Abi s tb bing MOF BEA Soe S tule Hou e tf wealsecbyess Om) x Bedeutdepy” :2 noes Se 1 enbrron by Sls 16 (empty arrayle gEL:5 null Sep” 4 Glass-14(Page:6) eee mma as MELA) se svar = 0; 7/ Evaluates to true because $var is empty if (empty ($var)) { echo '$var is either 0, empty, or not set at all’; 1 output: $var is either 0, empty, or not set at all is_bool() Bie thyp talsecstruciboolean/ Yi booleamytys FUEL AG Mees” $a = false; $b = 0; // Since $a is a boolean, this is true if (is bool ($a)) { echo "Yes, this is a boolean"; d // Since $b is not a boolean, this is not true if (is bool ($b)) { echo "Yes, this is a boole: is_int() sfalsezatruat integers Ses hie integerLinl Derg sey” print ‘$a is integ ) output: $a is integer is_string() Bie typ stalsesutrucin tinue Left tL bihbner tito $a = “hello world"; i€(is_string($a)) { print ‘$a is string'; , output: $a is string Cat ag) Coren ET eT TTS is_float() Pie AyArtalsecutruei float We floaters Leilene” $a = 55.2235; if(is_float($a)) { print ‘$a is float’; ) output: $a is float is_double() -ethe0UAS is_float () M4 unset() Pew ie $b = 6; unset ($b) ; (Output Buffering) 644,257 1% Point Mecho, print ht Eigse Lebitespes tate hat SQurere rte hie een Fein unr bandit Mie mye MA contents te tet hitudi rectly Me tried £#Y pe Fut Lad xJueiiyslecholprint Jo 294, aif enguPaynamic SLiguletyye execution og Pe Ge bWL Oe uth Lic tgs Theavy Le EL Siang E16 FOL tut Mid LLb nm Feb og est Sa contents Ve Ae eet iiee it ieee etigolt/ofe suf output bufferinge tit i Lislzcontents ve etn ine HW row tt Sparseaht yf biel Creat) Coren e ET rT TTS Setne Se aint executes Me, AB re tt EIR EIS SIA posh ee WA eae Watanabe net PLN = bbe Le beside Seats wt biene tte Me PE en PHP LL Siege ob_end_flush() *% ob_start() ob_get_contents() * ob_end_clean() *& ree thyi tourer ties tp ehitiece AZ wig U8 op start () M2 Fterth YELL a feb uicontent gabe tr scontents VL Gut Ki MoE Sede Set taf execute tee H 4 ABUSE ob_end_fiush BLA Pe neater Q ASG i Le el uty EE reader fete? ut Ai ttened ge Se TK & ll ra Letuihantl eS to fineaders UR th op 2134 Re Gowarning Vn Ala contenteypuy PIP neadere Web UbUieute, Ai pEl Evi LU output buf tering ARE ACW Fle (US OAUF content JL fos Ge eit Ste TLE SC A Me header -Lbstsexecuten, * LAAN ete EY Bate LS tL ASB te PLT Seb Li fg re Loop Ut HTML ng Pen JEL Tt EMEP Lays contents ALLS HEP TL dott st huni ote hath Ap Be the aPsiehgiyl tevrovbbit Lehigh betie Sink rvide ile GIL r00p fet a Soutput buf fering A Se PO Ng pti ct Si bon i BEE ly bite Sees Sf elushhifin Sith Lc atablew Eig S Seg tie Met Shi fet cleanse tar tific ube ob_end_cleanigtT EM tegig pours lL APostinar tite suSob_get_contents header () zlcookies, sessions J ee Buel ize, Fe tne

    You might also like