//filterArrays($category_result,array(array("col"=>"id","val"=>"49"),array("col"=>"borrow_nid","val"=>"20160500064")));
function filterArrays($list = array(),$where = array()){
$index = 0;
foreach ($list as $key => $value){
$mached = 0;
foreach($where as $wk=>$wv){
//self::log($wv['col']);
//self::log($wv['val']);
if($value[$wv['col']] == $wv['val']){
$mached++;
}
}
if($mached==count($where)){
$data['row'] = $value;
$data['index'] = $index;
return $data;