snoopy.class.php
snoopy is a class of self - developed fsockopen, which is efficient and does not require server specific configuration support, can be used in the ordinary virtual host, but often problems. The official web site: http://sourceforge.net/projects
Snoopy is a PHP class that simulates the browser's functionality, gets the content of the web page, and sends the forms. The features of
Snoopy:
1, the content of the web page, the content of the web page, the text content of the web page (removing the HTML tag) fetchtext
3, the link to the web page, the form fetchlinks fetchform
4, the supporting agent host, the basic username / secret code verification, and the support setting. Eferer (route), cookies and header content (header file)
7, support browser redirection, and control the redirection depth of
8, can extend the link in the web to a high quality URL (default)
9, submit data and get the return value
requires more than PHP4. Since it is a class of PHP without expansion support, the server does not support the best choice of curl.
file_get_contents ()
file_get_contents is a simple package of fsockopen functionality, a little less efficient, but the success rate is very high, so I usually come when Snoopy is out of question. 5.0.0 has added support for context. With context, he can send header information, customize user agent, referer and cookies. 5.1.0 adds offset and maxlen parameters to read part of the file.
curl ()
has the most powerful function and can simulate almost all aspects of browsers. Efficiency is also high, supporting multi threading, but need to open the next curl extension.
cURL is a tool that uses URL syntax to transfer files and data, and supports many protocols, such as HTTP, FTP, TELNET, etc. PHP also supports cURL libraries, which are often used for remote page grabbing and collection.
some CMS will use the curl function, which requires the CURL extension to be opened on the server. The following is the specific method:
1, the three files under the EXT directory of PHP: php_curl.dll, libeay32.dll, and replicas to the system directory.
2,
in php.ini; remove
3 before extension=php_curl.dll semicolon, restart IIS or Apache
curl_exec ($ch);
curl_close ($ch);
>; *