0% found this document useful (0 votes)
6 views20 pages

PHP_asgn_2.pdf

The document discusses various PHP functions including date, time, string manipulation, and array handling. It provides examples of how to use these functions effectively in PHP code. Additionally, it touches on concepts like variable functions and anonymous functions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
6 views20 pages

PHP_asgn_2.pdf

The document discusses various PHP functions including date, time, string manipulation, and array handling. It provides examples of how to use these functions effectively in PHP code. Additionally, it touches on concepts like variable functions and anonymous functions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 20
iwPe , Whic ey ere a dexed ay Numenic A Clativ Ryvays D MUti dimensional pray between Implode and Expiod Explode Function im plo] €xPlade Function ex plod- Jes an avray into String || es OStzing intean ana ncti al x i ny_four Marr f di la bx pla Ec @® obs 0: = ri Returns Gb So eric yuMber given jute value oF checkdate C) time() ) dare c) PHP date Function isan in- built function that works ih dade A040 4yoes. the php date function is used +0 Foy Mat_G daze or +ime into a human Teadap\e for. ut SyNtax:- date (Formas, timestamp) mple:- <2 php echo" Toaday's dade is:" ; $ today = daze Cal my" 7 today ; O/P:- Today's date is +$1- Ol- 2024 @ Time C) the time © Function is used to get tt At time as a UNix timestamp (the Mumbeyr oF seconds since the beginning of the Unix epoch nuary 11970 00+ 60:00 Gm) Example:- ", echo (date CF® d,¥h:i:9 A/S timesia: mp)) I> 7344 pm TANUARY Oo! ONG With | +y- word- count () Function is 4 built-in fur Hp andis used 40 rerUrN 1M FOYMas ign dS used in agtring Jike +orcL umbe, StI , POSItIONS OF the Words jp tion f tt U oxdin +he Phe ($string, $ve+urNWal, $ Chaye) ; element 10 Oyvay M4 DYESENF If} ® Str-Word-Count (> Count ¢he Number oF woya: na String Qx'~ Sts-Word- Count (St ring ) ple:- O/P:- Ushi yaday Gee pwhat IrrOY 2 How +0 store data: in array ? Qns'= AN aryay in PHP is an Ordered Map Ble mat 1S Atype that associate vasues to ik eys d5 +he Functior <* Php $ Person = array ( Array ( Mob Name" => " Rusht ~yadav "; =" 94322512105", 2 *rusht yadav@2g3. Com", du FPDF is a PHP class | Fies - wi Which qilows + aot te Sa Hes ra PHP code+F form DF anda Boe ee 40 use and i+ 3 eee fee His. ek 40 2a dit does not yequire ony ae MOY Use i+ |For any Kind of uscae YY APL Keg 10 Lessee y Kind of usage and mod Fy it xample' <9 php “require CrpAF. php"); ¢ paf = new FPDP 0; 4 paf = Add page Od; $ PAF ~> Seat Font U Ariat) '8),16), j Spa +> CeLt (60/10/' HELIO PHP Moria |" 11) $ PAF > Output 02; rz g tate At viGble Function Ex plas A it GonRTexal ans'~ PHP Supports +he concept OF vawiable functions: this Means that iF a variable Mame has parenth= eses appended to 'ty PHP will look For a Function With the same name as whatever the variable ev= quutes to, and wiladtempt to execute i¢:Among other ahings.this can be usedk implement Cou\ba cks, function tavles and so forth Exqmple:- <2 PhP - -— function simple O pie 0) Lb I2\0"7 g : echo"1n sim g argument was'$arg' p) aus simple WIS Alcuta L) YOu use the Function ~ate (imc Yed, green ‘big the image you are Working green:and blue ComPponen { WaNt Solid ved, OrcUulacate A red yajue oF 2 ) value OF O MAGECOlorAUIOCate a xed ($image 2.00,0,'0 9; t QOIO DyMouUs Functionif when )-AWa you need r 0 1 Yat 9 Smcul to Y Function Cor Ng OF as th vou as iC Purpose, such 4 cauiback YMOUS FUNCIION aiiow +he Creasion oF ee ch have no Specipied c name 9 ore +O 5 what is array ? How +0 Store AG payra Ingi- See Answer oF @:lo g:41 8 Ne Use OF SialeOQ and strrevO) ce the answer of @-g @andG@p A itive _cind Mmutti-dimensionar arrys ee the answer af Q14 D9 String Functions with exampie @® Vewords O GD simlenb f Lpy See the answer of @9:!¢ pervAtionS ON String strpos 0 ‘Satinas the position GF ihe First occuyre! nce oF a String inside another String (case- Sensi syntax:- (Staring , text) xample:- <2? PhP F 5 cae etrpos ("PHP Contains for: loop, For each and while loop", loop’); @>

You might also like