<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style>
li{
font-size:13px;
}
li.red{
color:#F00;}
#mingdan{
margin-left:5px;
}
</style>
</head>
<body>
<?
set_time_limit(0);
//$now=date("Y-m-d");
//$count=0;
//获取所有的最新用户和事业单位
$url1 = "http://www.tongda2000.com/index.php";
$ch=curl_init($url1);
curl_setopt($ch, CURLOPT_URL,$url1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //获得结果不直接输出
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$out_put=curl_exec($ch);
$str=curl_getinfo($ch);
// echo $str['http_code'];
if($str['http_code']==200){
$a=1;
}else{
$a=2;
}
//echo "<hr>";
if($a==1){
$contents1 = file_get_contents($url1);
//如果出现中文乱码使用下面代码
if($contents1){
$getcontent = iconv("gb2312", "utf-8",$contents);
//echo $contents;
$mode1 = "/<i class=\"dynamicImage2\">(.*) <i class=\"dynamicImage3\">/is";
preg_match_all($mode1,$contents1,$matches1);//获取最新用户的
//print_r($matches1);
$zxyh_str=$matches1[0][0];//获取最新用户的名称
//echo $zxyh_str; //最新用户
$mode2 = "/<ul id=\"dynamic_msg3\">(.*)<\/ul>/is";
preg_match_all($mode2,$zxyh_str,$matches2);
//print_r($matches2);
$zxyh_str2=$matches2[0][0];
echo "<div id=\"mingdan\">";
echo iconv("gbk","UTF-8",$zxyh_str2);
//echo $zxyh_str2;
echo "</div>";
}
}
?>
</body>
</html>