Итак, мне нужно скачать файл, чтобы выполнить проверку, я должен проверить, является ли загруженный файл XML или ZIP.
У меня есть следующий код:
$url = $return->DocXMLLink; //link to download the file
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FAILONERROR, true);
$response = curl_exec($ch);
//by here I may get the file extension and do something
Заранее спасибо