Open
Description
Description
The following code:
<?php
$ch = curl_init();
$url = 'https://epapucs.hu/wp-content/uploads/2024/11/F318482161_2.webp';
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, $url);
curl_exec($ch);
$ct = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
var_dump($ct);
$info = curl_getinfo($ch)['content_type'];
var_dump($info);
curl_close($ch);
Resulted in this output:
bool(false)
NULL
I'd expect these two values to be the same. It's hard to handle errors when a false value is returned when there's no error.
These are the first elements of curl_getinfo associative_array:
array(41) {
["url"]=>
string(63) "https://epapucs.hu/wp-content/uploads/2024/11/F318482161_2.webp"
["content_type"]=>
NULL
["http_code"]=>
int(200)
PHP Version
PHP 8.4.1
Operating System
macOS 15.1