PHP-voorbeelden
PHP-voorbeelden
Praktische codevoorbeelden in PHP voor veelgebruikte taken
Data ophalen met cURL
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://jouwdomein.nl/api/v1/woometadatas");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"X-User-Email: [email protected]",
"X-Api-Token: jouw-api-sleutel"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);