@file_get_contents() and curl failed to get page contents, I need alternate code
some sites are blocking @file_get_contents and the curl code also. I need code(PHP) that circumvents that problem. I only need to get the page contents so I can extra开发者_运维知识库ct the title.
You probably need to set the user agent string to emulate a "real" browser:
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:2.0) Gecko/20110319 Firefox/4.0');
精彩评论