0 order by modify_time DESC limit 0,50"; $others = PDO_FetchAll($query,array($_COOKIE["userid"])); foreach ($others as $key => $value) { # remove exist record if(!isset($exist_id[$value["id"]])){ $output["others"][] = $value; } } $output["article_id"]=$article_id; echo json_encode($output, JSON_UNESCAPED_UNICODE); } else{ echo json_encode(array(), JSON_UNESCAPED_UNICODE); } ?>