Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6205811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:20:18+00:00 2026-05-24T05:20:18+00:00

<?php function get($get){ $ch = curl_init(http://www.google.com/); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); echo $output = curl_exec($ch); }

  • 0
<?php
function get($get){
        $ch = curl_init("http://www.google.com/");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        echo    $output = curl_exec($ch);
}
get("stackoverflow");

works fine

However stackoverflow’s API

<?php
function get($get){
        $ch = curl_init("http://api.$get.com/1.1/users/?filter=genesis&max=10000&min=5000");

        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        echo    $output = curl_exec($ch);
}
get("stackoverflow");

looks wrong

Is it bug of SO’s API? Does this belong to Meta?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T05:20:18+00:00Added an answer on May 24, 2026 at 5:20 am

    Try to add

    curl_setopt($ch,CURLOPT_ENCODING , "gzip");
    

    to your code. API’s response is gzip encoded

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code <?php function get(){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, http://stackoverflow.com/); curl_setopt($ch,
This is my code: function get_remote_file_to_cache(){ $sites_array = array(http://www.php.net, http://www.engadget.com, http://www.google.se, http://arstechnica.com, http://wired.com); $the_site=
<?php $url='http://edition.cnn.com/?fbid=4OofUbASN5k'; $var = fread_url($url);// function calling to get the page from curl $search
I'm using http://www.barattalo.it/2010/08/09/send-push-notification-to-iphone-with-php-and-pushme-to/ When i call the function i get the error messages. Notice:
I am now running my code on a web hosting service http://xtreemhost.com/ <?php function
So here is my code: <?php $url = http://www.site.com/whcms/includes/api.php; # This is not the
I have followed all the instructions here: http://www.tonyspencer.com/2003/10/22/curl-with-php-and-apache-on-windows/ to install & config apache get
I found this function that does an AWESOME job (IMHO): http://nadeausoftware.com/articles/2007/06/php_tip_how_get_web_page_using_curl /** * Get
function get_data($url) { $ch = curl_init(); $timeout = 5; curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); $data =
How can I get a PHP function go to a specific website when it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.