php - file get content with json not working -
www.youtubeinmp3.com/fetch/?format=json&video=http://www.youtube.com/watch?v=i62zjga8jom
example output :
{ "title":"happy forever alone day (forever alone song)", "length":"125", "link":"http:\/\/youtubeinmp3.com\/download\/get\ /?i=k1makl%2fylh6kutehqyqlg9xwtuuwo" }
i want using php json file content not working.
<?php $json_url = "www.youtubeinmp3.com/fetch/?format=json&video=http://www.youtube.com/watch?v=i62zjga8jom"; $json = file_get_contents($json_url); $data = json_decode($json, true); echo "<pre>"; print_r($data); echo "</pre>"; ?>
but nothing working please me .. $json_url = "www.youtubeinmp3.com/fetch/?format=json&video=$videoid"; $videoid dyanamic value getting using post variable .
likie
<?php $video=$_post['yturl']; echo $video;?>
thanks.
using code output.
$curlsession = curl_init(); curl_setopt($curlsession, curlopt_url, 'www.youtubeinmp3.com/fetch/?format=json&video=http://www.youtube.com/watch?v=i62zjga8jom&chof=json'); curl_setopt($curlsession, curlopt_binarytransfer, true); curl_setopt($curlsession, curlopt_returntransfer, true); $jsondata = json_decode(curl_exec($curlsession)); curl_close($curlsession); echo "<pre>"; print_r($jsondata); echo "</pre>";
Comments
Post a Comment