3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = json_decode(file_get_contents('http://odnoklassniki.ru/dk?cmd=videoPlayerMetadata&mid=22126791276'), true); $return = array(); foreach($data['videos'] as $videos){ $filename = $videos['name']; $url = $videos['url']; $type = 'mp4'; $return[] = array( 'file' => $url, 'type' => $type, 'name' => $filename, ); } echo json_encode($return); ?>

preferences:
27.75 ms | 402 KiB | 5 Q