$value) { if(strpos(strtolower($value),strtolower($keyword))!==false){ if(strpos($value,"(")>-1){ $value=substr($value,strpos($value,"(")); echo "combine("; }elseif (strpos($value,")")>-1) { $value=substr($value, 0,strpos($value,")")); } ?> -1){ echo ")"; } }else { echo $value; } if (($key<$list_count-1)) echo ", "; } } //输入关键字,搜索某基因信息 function get_search_list($keyword,$Biomarker_type,$Cancer_type,$Function_type,$Species,$page){ $Cancer_type=strtolower($Cancer_type); if($Cancer_type=="all cancer") $Cancer_type=""; $Species=strtolower($Species); if($Species=="uncertain") $Species=""; $name=$Function_type."_".$Biomarker_type; $select_nr="select *from $name WHERE Biomarker_symbol like '%$keyword%' and Species like '%$Species%' and Cancer_type like '%$Cancer_type%'"; if($page<1) $page=1; $total=$Db->query($select_nr)->num_rows; $begin=($page-1)*15; $select_nr=$select_nr." limit $begin,15"; $rt = $Db->query($select_nr); $data=array(); while ($result=$rt->fetch_assoc()){ $list=array(); foreach ($result as $key => $value) { array_push($list, $value); } array_push($data, $list); } return json_encode(['data'=>$data,'msg'=>'查询成功','code'=>1,'total'=>$total]); } //读取browse列表,以下仅为部分,其他原理类似 function get_browse_list($type,$page){ if($type=="1-1-1") $select_nr="select *from diagnostic_mrna"; if($type=="1-1-2") $select_nr="select *from diagnostic_mirna"; $type=(int)$type; if($page<1) $page=1; $total=$Db->query($select_nr)->num_rows; $begin=($page-1)*15; $select_nr=$select_nr." limit $begin,15"; $rt = $Db->query($select_nr); $data=array(); while ($result=$rt->fetch_assoc()){ $list=array(); foreach ($result as $key => $value) { array_push($list, $value); } array_push($data, $list); } return json_encode(['data'=>$data,'msg'=>'查询成功','code'=>1,'total'=>$total]); }