Prayer Times

KOSTENLOS
Durch meezaan | Aktualisiert 2 years ago | Tools
Popularität

9.7 / 10

Latenz

109ms

Service Level

100%

Zurück zu allen Diskussionen

i want to use this api

Rapid account: Waseemtunio
waseemtunio
5 years ago

can you hep how to use this api through curl use in php . i am using this type of code but something wrong because api did not show any result
$url = “https://aladhan.p.mashape.com/timingsByCity?city=karachi&country=pakistan”;
// request timeout in seconds
$timeout = 10;
// Custom headers. X-Mashape-Key is mandatory, you can add more if you want
$headers = array(
“X-Mashape-Key: tOIEHtjceZmshwh6kmt62lH3P0gNp1RVL6ojsnP5oRUekQ027q”,
“Accept: application/json”

);
// Request Type: GET | POST | PUT | PATCH | DELETE
//$method = 'GET'; 
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers );
//curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);
echo $data;
Rapid account: Waseemtunio
waseemtunio Commented 5 years ago

because (https://aladhan.com/prayer-times-api) that api does not show prefect result based on city like karachi

Rapid account: Meezaan
meezaan Commented 5 years ago

Is there a reason why you are not using Guzzle for PHP or the AlAdhan PHP API Client (https://github.com/islamic-network/aladhan-api-client-php)?

Nehmen Sie an der Diskussion teil - fügen Sie unten einen Kommentar hinzu:

Anmelden / Registrieren, um neue Kommentare zu veröffentlichen
Bewertung: 5 - Stimmen: 2