From 34bd848259d3a20663fcee5a7d232ae647ee3198 Mon Sep 17 00:00:00 2001 From: wanyongkang <937888580@qq.com> Date: Wed, 4 Nov 2020 16:06:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=BA=E5=AD=90=E7=88=AC=E8=99=AB=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/data/get_line_lIst.php | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 script/data/get_line_lIst.php diff --git a/script/data/get_line_lIst.php b/script/data/get_line_lIst.php new file mode 100644 index 0000000..ef36af7 --- /dev/null +++ b/script/data/get_line_lIst.php @@ -0,0 +1,45 @@ +(.*\s*?)<\/tbody>/is", $qiangzi, $result); + +preg_match_all("/(.*?)<\/tr>/is", $result[0], $result); + +// echo $result[0][0]; +// print_r($result[0]); +$list = []; +foreach ($result[0] as $key => $info) { + preg_match_all("/(.*?)<\/td>/is", $info, $data); + $get_data = []; + $td_info = $data[1]; + if (isset($td_info[1])) { + $daikuan = explode('IP', trim($td_info[2])); + $get_data['address'] = trim($td_info[0]); + $get_data['yuming'] = trim($td_info[1]); + $get_data['ip'] = trim($daikuan[0]) . 'IP'; + $get_data['daikuan'] = trim($daikuan[1]); + preg_match_all("/(.*?)<\/span>/is", trim($td_info[3]), $status); + $get_data['status'] = $status[1][0]; + } else { + preg_match_all("/(.*?)<\/font>/is", trim($td_info[0]), $address); + $get_data['address'] = $address[1][0]; + } + $list[] = $get_data; +} +echo json_encode(['data' => $list]);