
19/10/1982
FRANCAIS
<?php
//clef api
$clefAPI = ‘YWxsOzAuOTMzMDY0MDAgMTY3ODkyMDg4MjtTV2RzYTJAZDsyNDYwMDE5LjQ1NDY2’;
//année à appeler
$year = date(‘2023’);
//url d’appel des éclipses
$url =
‘http://www.lunopia.com/call?what=ec&timeZone=Africa%2FBrazzaville&year=2022&key=YWxsOzAuOTMzMDY0MDAgMTY3ODkyMDg4MjtTV2RzYTJAZDsyNDYwMDE5LjQ1NDY2;
//récuperation des données au format JSON
$dataJSON = file_get_contents($url);
//conversion des données JSON en un tableau PHP
$arrayEclipses = json_decode($dataJSON, true);
//si le tableau n’est pas vide
if(!empty($arrayEclipses)){
//affiche le tableau
print_r($arrayEclipses);
//si le tableau est vide
}else{
//affiche le message d’erreur
echo $dataJSON;
}
?>
http://www.lunopia.com/call?what=ec&timeZone=Africa%2FBrazzaville&year=2022&key=YWxsOzAuOTMzMDY0MDAgMTY3ODkyMDg4MjtTV2RzYTJAZDsyNDYwMDE5LjQ1NDY2
<?php
//clef api
$clefAPI = 'YWxsOzAuOTMzMDY0MDAgMTY3ODkyMDg4MjtTV2RzYTJAZDsyNDYwMDE5LjQ1NDY2';
//année à appeler
$year = date('2023');
//url d'appel des éclipses
$url =
'http://www.lunopia.com/call?what=ec&timeZone=Africa%2FBrazzaville&year=2022&key=YWxsOzAuOTMzMDY0MDAgMTY3ODkyMDg4MjtTV2RzYTJAZDsyNDYwMDE5LjQ1NDY2;
//récuperation des données au format JSON
$dataJSON = file_get_contents($url);
//conversion des données JSON en un tableau PHP
$arrayEclipses = json_decode($dataJSON, true);
//si le tableau n'est pas vide
if(!empty($arrayEclipses)){
//affiche le tableau
print_r($arrayEclipses);
//si le tableau est vide
}else{
//affiche le message d'erreur
echo $dataJSON;
}
?>

