Download presentation

Presentation is loading. Please wait.

Published byMateo Strong Modified over 4 years ago

1
Specifying with Array () : - It takes a Certain number of comma – Seprated key => value pairs. Syntax : array( [ key => ] value ……. )

2
<?php $a [ ] =12 ; $a [ ] =32 ; $a [ ] =12.32 ; $a [ ] = “ viral Koradiya”; Print $a [ 0 ].” ” ; Print $a [ 1 ].” ” ; Print $a [ 2 ].” ” ; Print $a [ 3 ].” ” ; ?>

3
<?php $a [ 0 ] [ 0 ] =12 ; $a [ 0 ] [ 1 ] =32 ; $a [ 1 ] [ 0 ] =12.32 ; $a [ 1 ] [ 1 ] = “ viral Koradiya”; Print “$a [ 0 ] [ 0 ]”. “   ;”.“$a [ 0 ] [ 1 ]”.” ” Print “ ’ Print “$a [ 1 ] [ 0 ]”.” ” Print “$a [ 1 ] [ 1 ] ;” ?>

4
<?php $a [ 0 ] [ 0 ] = 12 ; $a [ 0 ] [ 1 ] = 32 ; $a [ 1 ] [ 0 ] = 12.32 ; $a [ 1 ] [ 1 ] = “ viral ”; For ($i = 0 ; $i <= 1 ; $i++ ) { for($j = 0 ; $j <= 2 ; $j++ ) { print $a [ $i ] [ $j ]. ” ” ; } ?>

5
<?php $ar = array ( 10,110,210.10, “VIRAL” ); Foreach( $ar as $new1 => $new2) { print “Keys [“.$new1.”]”. “ value ”.$new2. “ ”; } ?>

6
Example 1 : $ages = array(“Viral “ => 10, ”Meet” => 20, “Swat” =>30 );

7
Example 2 : $ages [ ‘viral’ ] = “20 “; $ages [ ‘vijay’ ] = “25 “; $ages [ ‘Meet’ ] = “30 “; ~> Id Keys can be used in a Script :

8
Example 3 : <?php $ages [ ‘viral’ ] = “20 “; $ages [ ‘vijay’ ] = “25 “; $ages [ ‘Meet’ ] = “30 “; Echo “Viral Age is :”.$ages[ ‘Viral ‘ ]. “Years is old. “ ?>

9
Example 4 : <?php $ar =array(5,”One”=>34, “Two”=>50, 70.62, “Hello”=>”viral”); Foreach( $ar as $new1 => $new2 ) { print $new1.”=>”. $new2.” ”; } ?>

Similar presentations

Presentation is loading. Please wait....

OK

Systems with No Solution or Infinitely Many Solutions

Systems with No Solution or Infinitely Many Solutions

© 2019 SlidePlayer.com Inc.

All rights reserved.

To make this website work, we log user data and share it with processors. To use this website, you must agree to our Privacy Policy, including cookie policy.

Ads by Google