p;$ArrayTqTem3=$ArrayTqTem3[0]; //温度 $ArrayTqTem4=explode(''<tr><td>'',$ArrayTq[0]); $ArrayTqTem4=explode(''</td></tr>'',$ArrayTqTem4[3]); //$ArrayTqTem4=explode(''<td>'',$ArrayTqTem4[0]); $ArrayTqTem4=$ArrayTqTem4[0]; if( !$ArrayTqTem2 or !$ArrayTqTem3 or !$ArrayTqTem4) { return false; } //$TqVar=$ArrayTqTem2.",".$ArrayTqTem3."<br>气温:".$ArrayTqTem4; $weather[0]=$flash; $weather[1]=$ArrayTqTem2; $weather[2]=$ArrayTqTem3; $weather[3]=$ArrayTqTem4; return $weather; } $weather = get_weather(); ?>
上面写的是php文件,你没有echo当然不能正常显示啦
<?php error_reporting(0); include_once ("../include/weather.php"); ?> <!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> html,body {margin:0;padding:0; font-size:12px;} div {width:178px; height:58px;position:relativ;position:relative} img {width:178px; height:58px; z-index:1;position:absolute; border:0} object { margin-top:2px; margin-left:8px;} span{position:absolute;top:2px;right:12px;} li{font-family:Verdana,宋体;list-style:none;margin-top:3px; letter-spacing:1px;} </style> </head> <body> <div> <a href="http://www.ttqx.com.cn/tqyb/" target="_blank"><img src="http://links.ezz.cc/blank.gif" /></a><?php echo $weather[0]; ?><span><li><?php echo $weather[1]; ?></li> <li><?php echo $weather[2]; ?></li> <li><?php echo $weather[3]; ?></li></span> </div> </body> </html> |