3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $username = 'UU3dESJmRgwl8j3X80c9wTwg'; // YouTube API URL retrieves the fields we want in JSON format so that it's super easy to work with $api_url = 'https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=%s&key=AIzaSyAMUb-pd1gAIeNmu3nUrarg6_397QJQXEo'; // Get the videos for our user with 'wp_remote_get()' $response = http_get( sprintf($api_url, $username) , array("timeout"=>1), $info ); echo(response); echo($info); // Let's decode what we retrieved so that we can store it efficiently $item_data = json_decode( $info ); // If our info isn't in an array then these next steps won't work-- return false if ( !is_array( $item_data ) ) { return false; } // Let's sort through everything we've got. We'll keep the stuff we need and drop the rest from the array. $item_data = $item_data['feed']['entry']; foreach(array_keys($item_data) as $key) { echo($item_data[$key]['title']['$t']); }
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function http_get() in /in/RmBCq:8 Stack trace: #0 {main} thrown in /in/RmBCq on line 8
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Fatal error: Call to undefined function http_get() in /in/RmBCq on line 8
Process exited with code 255.