rzajac
rzajac

Reputation: 1601

PHP curl text vs binary data

How do I check multiple URLs with PHP. The data returned by from the urls might be in text (ASCII) format or in binary. How do i distinguish which one was returned.

My code has to just detect if the data is binary or text. Nothing else.

Thanks

Upvotes: 0

Views: 1049

Answers (1)

zerkms
zerkms

Reputation: 255005

Look at the content-type header

...
$response = curl_exec($ch);
$info = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
var_dump($info);

Upvotes: 1

Related Questions