fname[$t]=$filename; $t++; } if($t<1){ $ret->msg="No files found"; } else $ret->status="y"; echo json_encode($ret); ?>