tags:

views:

69

answers:

1

I will explain clearly

$array  = array("1" => array(0 =>"aa",1 =>"bb", 2 => "cc",3=>"dd"),
                "2" => array(0 =>"aa1",1 =>"bb1", 2 => "cc1",3=>"dd1"));

In this two dimension are

$array2[$a][$b];

i know $a value ..$b is unknown

if i using $a =1 means i want to filter array(0 =>"aa",1 =>"bb", 2 => "cc",3=>"dd") this array

but i need to get the second array element .. Any function is available to do that

Someone please help me!

+3  A: 

This is how you do it:

$a = array(1=>'a', 2=>'b', 3=>'c');

//display the value with key 2:
echo $a[2];

//remove the value with key 2 (throw-out / bring-out in your language)
unset($a[2]);

//now display whole array to show that value with key 2 is gone
print_r($a);

This outputs:

b

And then it outputs:

Array ( [1] => a [3] => c )

shamittomar