先上代码:
//获取td栏的代码 $regex = "/<td Height=\"30\">([\s\S]*?)<\/td>/"; $str = file_get_contents('http://www.zh818.com/get/quanguo-jg/'); $matches = array(); preg_match_all($regex, $str, $matches); echo "\n"; //获得网址 $href ='/<a .*?href="(.*?)".*?>/is'; $href_single = array(); if(preg_match($href, $matches[0][1], $href_single)) //根据获得的网址获取表格信息 $regex = '/<table border="1" width="100%">.*([\d\.]+?).*<\/table>/sU'; $str = file_get_contents($href_single[1]); $matches = array(); if(preg_match($regex, $str, $matches)) $result = $this->transmitText($object, $matches);
查询了一下,好象是新浪sae的问题,但是不知道该怎么解决
SAE 不能使用 file_get_contents 函数
SAE 不能使用 file_get_contents 函数
嗯,最后用$f = new SaeFetchurl(); $str = $f->fetch($href_single[1]);搞定了,不过file_get_contents直接传入网址的字符串是可以使用的
微信是一款手机通信软件,支持通过手机网络发送语音短信、视频、图片和文字。微信可以单聊及群聊,还能根据地理位置找到附近的人,带给大家全新的移动沟通体验,有需要的小伙伴快来保存下载体验吧!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号