$new_array = array();
foreach($array as $val){
if(isset($new_array[$val['name']])){
$new_array[$val['name']][] =$val['value'];
}else{
$new_array[$val['name']] = array($val['value']);
}
var new_array = [];
$.each(array, function(key, val){
if($.inArray(val.name, uri)){
new_array.push(val.value);
}else new_array[val.name] = [val.value];
});