$arr_main_array = array('foo-test' => 123, 'other-test' => 456, 'foo-result' => 789);foreach($arr_main_array as $key => $value){ $exp_key = explode('-', $key); if($exp_key[0] == 'foo'){ $arr_result[] = $value; }}if(isset($arr_result)){ print_r($arr_result);}


