how to display the responce of curl in php

Solutions on MaxInterview for how to display the responce of curl in php by the best coders in the world

showing results for - "how to display the responce of curl in php"
Alina
10 Jan 2018
1$response = get_web_page("http://socialmention.com/search?q=iphone+apps&f=json&t=microblogs&lang=fr");
2$resArr = array();
3$resArr = json_decode($response);
4echo "<pre>"; print_r($resArr); echo "</pre>";
5
6function get_web_page($url) {
7    $options = array(
8        CURLOPT_RETURNTRANSFER => true,   // return web page
9        CURLOPT_HEADER         => false,  // don't return headers
10        CURLOPT_FOLLOWLOCATION => true,   // follow redirects
11        CURLOPT_MAXREDIRS      => 10,     // stop after 10 redirects
12        CURLOPT_ENCODING       => "",     // handle compressed
13        CURLOPT_USERAGENT      => "test", // name of client
14        CURLOPT_AUTOREFERER    => true,   // set referrer on redirect
15        CURLOPT_CONNECTTIMEOUT => 120,    // time-out on connect
16        CURLOPT_TIMEOUT        => 120,    // time-out on response
17    ); 
18
19    $ch = curl_init($url);
20    curl_setopt_array($ch, $options);
21
22    $content  = curl_exec($ch);
23
24    curl_close($ch);
25
26    return $content;
27}
queries leading to this page
get curl response in phpphp curl how to get response curl post php get response dataphp after calling curl how to exho the responsehow to get data from curl response in phphow to get response of a curl request in another request in phpcurl php responcephp what does curl respondcurl get response url phpphp curl get responscurl page to php echo responsehow can get reponse same format in curl in phpget response from curl phpget response bosy from curl phphow to output php curl get responsesget responce in curl phpphp get response datacurl response phpget response data curl post phpcall curl and get response curl phphow to get curl to return an integerphp how to read curl responsehow to use curl in laravelcurl return headers phpcurl get api res phpphp return result of curlphp curl get url responsecurl php print responsephp get responsehow to get text from curl response in phphow to get curl response in phpget html resalt in curl phpoutput response set in curl in phpcurl response returning to client instead of phpcurl php why print reponsephp get curl resultcurl php with no resposnecurl get result phphow to do something when you resive curl request phpphp get curl respponsesend long string in php curlget responce code with php curlcurl get text response phpphp curl response echohow to display the responce of curl in phpget response phphow to get html resuft curl in phpreturn curl response phpget http code of curl response phpdisplay curl result phphow to call api in php without curlphp echo curl ststusreturn clean curl response phpcatch response from curlphp curl what does returnanswer doshow curl result phpchanging the htto response status code golanghow to receive api in php without curlphp print responsephp curl get responsecurl print response php php get response from curl execcurl php responseget response from a url php curlget curl request result phphow to get output of curl request data in phpecho curl response phpecho curl response objectcurl get response phpphp curl echo responseget curl resalte phpphp dump curl responsecurl exec get responsehow to display the responce of curl in php