https://www.example.com/api/pub/v2/veri ... AXBS4H2T9d
Мне нужно извлечь идентификатор lr_01HT89SX627dFDPCAXBS4H2T9d из https://www.example.com/api/pub/v2/verifications/, идентификатор будет разным для каждого ответа.
Код: Выделить всё
Header: HTTP/2 201
Header: date: Sat, 30 Mar 2024 18:26:29 GMT
Header: content-length: 0
Header: location: https://www.example.com/api/pub/v2/verifications/lr_01HT89SX627dFDPCAXBS4H2T9d
Header: cf-cache-status: DYNAMIC
Код: Выделить всё
list($headers, $content) = explode("\r\n\r\n",$result,2);
foreach (explode("\r\n",$headers) as $hdr)
printf('
Header: %s
', $hdr);
echo $content;
Подробнее здесь: https://stackoverflow.com/questions/782 ... ponse-data