I have an array as follows:
$arr1 = array( 0 => array( \'name\' => \'tom\', \'age\' => 22 ), 1 => array( \'name\' => \'nick\',
$array = array(0 => array('name' => 'tom', 'age' => 22), 1 => array('name' => 'nick', 'age' => 18)); foreach($array as $arr => $a){ $names[] = $array[$arr]["name"]; } print_r($names); //Array ( [0] => tom [1] => nick )