<?php
$handle = fopen ("http://weather.cn.yahoo.com/weather.html?city=%E5%8C%97%E4%BA%AC", "rb");
$contents = "";
while (!feof($handle)) {
$contents = fread($handle, 1024);
$contents = trim($contents);
if($contents="<!--{{start:今日 -->") {
$start=true;
echo "ok";
}
if($start==true){
$today.=$contents;
}
if($contents=="<!--{{start:明日 -->"){
$start=false;
}
}
fclose($handle);
?>
$handle = fopen ("http://weather.cn.yahoo.com/weather.html?city=%E5%8C%97%E4%BA%AC", "rb");
$contents = "";
while (!feof($handle)) {
$contents = fread($handle, 1024);
$contents = trim($contents);
if($contents="<!--{{start:今日 -->") {
$start=true;
echo "ok";
}
if($start==true){
$today.=$contents;
}
if($contents=="<!--{{start:明日 -->"){
$start=false;
}
}
fclose($handle);
?>
$handle = fopen ("http://weather.cn.yahoo.com/weather.html?city=%E5%8C%97%E4%BA%AC", "rb");
$contents = "";
while (!feof($handle)) {
$contents = fread($handle, 1024);
$contents = trim($contents);
if($contents=" <!--{{start:今日 --> ") { (这里应该是$contents==" <!--{{start:今日 --> ")
$start=true;
echo "ok";
}
if($start==true){
$today.=$contents;
}
if($contents==" <!--{{start:明日 --> "){
$start=false;
}
}
fclose($handle);
?>