请帮我理解一下这段PHP代码

来源:百度知道 编辑:UC知道 时间:2024/05/30 14:19:30
$id=$_POST['hpzl'];
$hp=$_POST['hp'];
$hm=$_POST['hm'];
$url = 'http://www.xtjsr.com/cx/2.php?id='.$id.'&hp='.$hp.'&hm='.$hm; //提交的路径吧?
$lines_array = file($url); //读取路径到数组 ??它的值是什么?
$lines_string = implode(',',$lines_array); //合并
eregi("<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" width=\"95%\" align=\"center\" style=\"background:#c2c2c2\">(.*)style=\"width: 618px; height: 10px\" width=\"618\">",$lines_string, $head);//将HTML 替换成 $URL?
$head[0] = strip_tags($head[0]);
$head=str_replace(",,\r\n","",$head);
$head=str_replace(",, \r\n","",$head);
$head=

$id = $_POST['hpzl'];
$hp = $_POST['hp'];
$hm = $_POST['hm'];
$url = 'http://www.xtjsr.com/cx/2.php?id=' . $id . '&hp=' . $hp . '&hm=' . $hm; //这里是想要获取内容的url
//$lines_array = file($url); //读取到的是一个数组,网页内容的每行作为一个数组元素
$lines_string = implode(',', $lines_array); //以,分隔来合并数组
eregi("<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" width=\"95%\" align=\"center\" style=\"background:#c2c2c2\">(.*)style=\"width: 618px; height: 10px\" width=\"618\">", $lines_string, $head); //取出网页里(.*)部分的内容,对照着取回来的内容看可能会更方便些
$head[0] = strip_tags($head[0]);//这里拿出取到的第一个匹配的内容,并去除掉html标记
$head = str_replace(",,\r\n", "", $head);
$hea