Keep deezer Album:id

225 views Asked by At

i want to keep album:id on deezer. that is my requete but $resultat_brut_deezer is empty. Why ? Thank's for your help.

$url_d = 'https://api.deezer.com/search?q=album:%22'.$album_title.'%22%20artist:%22'.$nom_aut.'%22';
$datadeezer =array('index'=>'0','limit'=>'1','output'=>'json');

$options_d = array(
    'http' => array(
        'header'  => "Content-type: application/x-www-form-urlencoded\r\n",
        'method'  => 'GET',
        'content' => "&".http_build_query($datadeezer)
    )
);
$context_d  = stream_context_create($options_d);
$resultat_brut_deezer = file_get_contents($url_d, true, $context_d);
$resultat_json_d=json_decode($resultat_brut_deezer);
1

There are 1 answers

0
m.nappee On

well i found it. $url_d = 'https://api.deezer.com/search?q=album:%22'.$album_title.'%22%20artist:%22'.$nom_aut.'%22';

replaced by: $url_d = 'https://api.deezer.com/search?q=album:%22'.urlencode($basic['title']->value.'%22');