WeChat developers cannot return data.

Source: Internet
Author: User
A strange problem that development cannot return data. This post was last edited by programmer_wei from 2014-03-1600: 46: 52 with the following code: & nbsp; & nbsp; & nbs strange issues that do not return data during development
At the end of this post, the code was edited by programmer_wei at 00:46:52:

// Get the code of the td column
$ Regex = "/ ([\ S \ S] *?) <\/Td> /";
$ Str = file_get_contents ('http: // www.zh818.com/get/quanguo-jg /');
$ Matches = array ();
Preg_match_all ($ regex, $ str, $ matches );
Echo "\ n ";

// Obtain the URL
$ Href = '// is ';
$ Href_single = array ();
If (preg_match ($ href, $ matches [0] [1], $ href_single ))

// Obtain the table information based on the obtained URL.
$ Regex = '/ . * ([\ D \.] + ?). * <\/Table>/sU ';
$ Str = file_get_contents ($ href_single [1]);
$ Matches = array ();
If (preg_match ($ regex, $ str, $ matches ))
$ Result = $ this-> transmitText ($ object, $ matches );

[Size = 13px] the function I want to implement is to send a request to a mobile phone user. the server obtains the specified information by using a regular expression in the html code of a website, and then returns it to the user through the interface, however, when a client user sends a request, it cannot receive the returned information. I thought it was caused by the timeout of the server connection to the corresponding website, however, when I change $ href_single [1] in the fourth last line of the code to an http URL, the mobile terminal can receive the returned information after testing, however, the content in $ href_single [1] is actually an http website. The formats are the same. what is the problem? [/Size]

------ Solution --------------------
SAE cannot use the file_get_contents function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.