FIll1992's post in Read data from multi-array? was marked as the answer
July 24, 2023
Thanks all for the Help! I have found the Solution:
<?php
$timestamp=time();
$uri = "https://api.cloud.kaufland.de/pdp-frontend/v1/316951680/offers?offset=0&limit=10&condition=used";
// Define all the mandatory headers
$headers = [
'Accept: application/json',
'Hm-Timestamp: ' . $timestamp,
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $uri);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$ch = json_decode(curl_exec($ch), true);
foreach ($ch["usedOffers"] as $area) {
$arrayname=$area["seller"]["name"];
$arrayprice=$area["price"];
echo '<br/>';
echo ''.$arrayname.' hat den Artikel für '.$arrayprice.' gelistet.';
}
?>