I am trying to format the data passed by the api in to key value paris for use with javascript the data right now is one big key and not in key value paris how can i get the data as key value paris and properly formated ?
<?php
header('Content-Type: application/json; charset=utf-8');
$url = file_get_contents('https://www.jiosaavn.com/api.php?_format=json&query=mere%20angne%20mein&__call=autocomplete.get');
$data = explode('[', $url);
$format = json_encode($data[1], true);
print_r($format);
?>