我想显示从三个网站采集的内容。
代码如下:
<div id=a>
echo file_get_contents("http://a.com");//采集a网站内容并显示
</div>
<div id=b>
echo file_get_contents("http://b.com");//采集b网站内容并显示
</div>
<div id=c>
echo file_get_contents("http://c.com");//采集c网站内容并显示
</div>
现在我想,当第一个网站内容没有出来时,第二个和第三个显示“请等待”。
有什么好办法?谢谢
代码如下:
<div id=a>
echo file_get_contents("http://a.com");//采集a网站内容并显示
</div>
<div id=b>
echo file_get_contents("http://b.com");//采集b网站内容并显示
</div>
<div id=c>
echo file_get_contents("http://c.com");//采集c网站内容并显示
</div>
现在我想,当第一个网站内容没有出来时,第二个和第三个显示“请等待”。
有什么好办法?谢谢
$v1=file_get_contents("http://a.com");//采集a网站内容并显示
echo $v1;
</div>
<div id=b>
$v2=file_get_contents("http://b.com");//采集b网站内容并显示
if($v1=="")
echo "waitting............";
else
echo $v2;
</div>
<div id=c>
echo file_get_contents("http://c.com");//采集c网站内容并显示 //这个如法炮制
</div>