我向 API REST 发出了 GET 请求,并获得了一些数据(base64 编码)。
现在我需要从结果中获得一些特定的值,但我不知道如何。
这是我到目前为止
<?php
//BUSCAR DOCUMENTOS
$service_url = 'http://192.168.4.77/api/Core.svc/core/PaginatedSearch/P/E/KFRpcG9EVEU6MzMgQU5EIEZjaEVtaXM6WzIwMTktMDYtMjEgVE8gMjAxOS0wNy0zMF0p/0/10';
$ch = curl_init($service_url);
curl_setopt($ch, CURLOPT_URL, $service_url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'AuthKey: top-secret',
'Content-Type: application/json',
'Accept: application/json',
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
$response = curl_exec($ch);
$err = curl_error($ch);
if ($err) {
echo "cURL Error #:" . $err;
} else {
$datos = json_decode($response,true);
foreach ($datos as $k => $v) {
$Result = $datos['Result'];
$Description = $datos['Description'];
$SearchTime = $datos['SearchTime'];
$TotalDocuments = $datos['TotalDocuments'];
$Data = $datos['Data'];
}
$test = base64_decode($Data);
var_dump($test);
}
curl_close($ch);
?>
这就是我得到的,需要获取值(例如:33 2284 21-06-2019 0:00:00)
任何帮助将非常感激。
冉冉说