3v4l.org

run code in 300+ PHP versions simultaneously
<?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 git.master, git.master_jit, rfc.property-hooks
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.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
41.23 ms | 401 KiB | 8 Q