Phpfile_get_contents function code for capturing page information
- $ Url = "http://bbs.55bbs.com ";
- $ Contents = @ file_get_contents ($ url );
- // Preg_match_all ("/
(.*?) <\/P>/is ", $ contents, $ content );
- Preg_match_all ("/(.*?) <\/H3>/is ", $ contents, $ content );
- Print_r ($ content [0]);
- ?>
For more complex page crawling, you can consider using the curl method. for details, refer to the following article: PHP uses CURL to forge the IP source. php uses curl to determine whether a remote file exists. php uses curl to forge the IP source code. php simulates logon to the QQ mailbox (detailed explanation of the curl Command) php curl learning summary the curl Command simulates form upload files. In addition, for usage of the php file_get_contents function, refer to the following articles: php file_get_contents function proxy get remote page code php file_get_contents function use problem PHP-CGI process CPU 100% and file_get_contents function relationship php use socket, curl, file_get_contents method POST data instance http://www.w3school.com.cn/php/func_filesystem_file_get_contents.asp |