3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function callInstagram($url) { $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => 2 )); $result = curl_exec($ch); curl_close($ch); return $result; } $tag = 'instabeachpro'; $client_id = "XXXXXXXXXXXXXXXXXXXXX"; $url = 'https://api.instagram.com/v1/tags/'.$tag.'/media/recent?client_id='.$client_id; $inst_stream = callInstagram($url); $results = json_decode($inst_stream, true); //Now parse through the $results array to display your results... foreach($results['data'] as $item){ $image_link = $item['images']['low_resolution']['url']; echo '<img src="'.$image_link.'" />'; }
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/ocdD8:4 Stack trace: #0 /in/ocdD8(22): callInstagram('https://api.ins...') #1 {main} thrown in /in/ocdD8 on line 4
Process exited with code 255.
Output for 5.3.6 - 5.6.28
Fatal error: Call to undefined function curl_init() in /in/ocdD8 on line 4
Process exited with code 255.