您好,欢迎访问一九零五行业门户网

微信开发不能返回数据的奇怪问题

先上代码:
//获取td栏的代码 $regex = /([\s\s]*?)/; $str = file_get_contents('http://www.zh818.com/get/quanguo-jg/'); $matches = array(); preg_match_all($regex, $str, $matches); echo \n; //获得网址 $href ='//is'; $href_single = array(); if(preg_match($href, $matches[0][1], $href_single)) //根据获得的网址获取表格信息 $regex = '/.*([\d\.]+?).*/su'; $str = file_get_contents($href_single[1]); $matches = array(); if(preg_match($regex, $str, $matches)) $result = $this->transmittext($object, $matches);
[size=13px]我要实现的功能是微信手机端用户发送请求,服务器通过在一个网站上的html代码中使用正则表达式获取指定信息,然后通过微信接口返回给用户,但是现在当微信端用户发出请求后并不能收到返回的信息,本来以为是不是因为服务器连接到相应网站抽取信息超时引起的,但是当我把代码倒数第四行的$href_single[1]直接改为http网址时,经过测试微信手机端又可以接收到返回信息了,但是$href_single[1]里面的内容实际上就是一个http网址啊,他们格式都是一样的,这到底是怎么回事呢?[/size]
回复讨论(解决方案) 查询了一下,好象是新浪sae的问题,但是不知道该怎么解决
sae 不能使用 file_get_contents 函数
sae 不能使用 file_get_contents 函数
嗯,最后用$f = new saefetchurl();   $str = $f->fetch($href_single[1]);搞定了,不过file_get_contents直接传入网址的字符串是可以使用的
其它类似信息

推荐信息