Why Nostr? What is Njump?
2024-07-22 14:06:13
in reply to

Mike :nixos: on Nostr: This is my function: function check_image_url($url) { $ch = curl_init($url); ...

This is my function:

function check_image_url($url)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // Follow redirects
curl_setopt($ch, CURLOPT_TIMEOUT, 2); // Set a timeout
curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

return $http_code != 404;
}
Author Public Key
npub1wapavjt4y0jv8p5t4lnqlhm0d4k6tzcwveh4k5k8ezuewrmjwjmqecap6u