php - Accept-Language of CURLOPT_HTTPHEADER does not work -


curl set language header

i trying source code of facebook's homepage using curl, chinese due location of server host. reason, added accept-language of curlopt_httpheader change language english, failed. according answer quoted above, below php code of curl tried:

<?php  $url = "http://www.facebook.com/";  if(isset($_server['http_user_agent']))     $user_agent = $_server['http_user_agent']; else     $user_agent = "";  $options = array(     curlopt_returntransfer => true,     // return web page     curlopt_header         => false,    // don't return headers     curlopt_followlocation => true,     // follow redirects     curlopt_httpheader     => array("accept-language: en-us;q=0.6,en;q=0.4"),     curlopt_useragent      => $user_agent);  $ch      = curl_init($url); curl_setopt_array($ch, $options); $content = curl_exec($ch); $err     = curl_errno($ch); $errmsg  = curl_error($ch); $header  = curl_getinfo($ch); curl_close($ch);  echo $content;  ?> 

but still showed chinese:

the facebook chinese.

how can solve problem?


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -