Skip to main content
replaced http://stackapps.com/ with https://stackapps.com/
Source Link

Here is the relevant section of code from stack.PHPstack.PHP.

$ch = curl_init();
    
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_ENCODING,'gzip');  // Needed by API
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
    
$data = curl_exec($ch);

Here is the relevant section of code from stack.PHP.

$ch = curl_init();
    
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_ENCODING,'gzip');  // Needed by API
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
    
$data = curl_exec($ch);

Here is the relevant section of code from stack.PHP.

$ch = curl_init();
    
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_ENCODING,'gzip');  // Needed by API
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
    
$data = curl_exec($ch);
Source Link
Nathan Osman
  • 23.3k
  • 11
  • 61
  • 107

Here is the relevant section of code from stack.PHP.

$ch = curl_init();
    
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_ENCODING,'gzip');  // Needed by API
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
    
$data = curl_exec($ch);