Posted by: Sourav | February 11, 2012

Revisiting arrays in PHP


<?php
        $array1 = array(2,3,4,5,6,7,7,8,7,4,76);
        $array2 = array(“sourav”,”networking”,”CCNP”,array(“a”,”b”,”c”));
        echo $array2[3][1];echo “<br />”;
        echo $array1[0];
        $array2[3]=”cat”;echo “<br />”;
        echo $array2[3];echo “<br />”;
        $array4=array(“firstname” => “Sourav”,”lastname” => “Bhattacharya”);
        echo $array4[“firstname”].” “.$array4[“lastname”];
        $array4[“firstname”]=”Souvik”;
        echo “<br />”;
               echo $array4[“firstname”].” “.$array4[“lastname”].”<br />”;
        ?> <pre><?php print_r($array4);?></pre>
       

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: