merner adlı üyeden alıntı: mesajı görüntüle
file_get_contents bir çok sunucuda kapalı olabilir,
yerine curl kullanmak gerekir, ufak bir araştırmayla bulduğum cevabı biraz düzelttim.

function getImg($url)
{
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
    curl_setopt($ch, CURLOPT_SSLVERSION, 6);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    $data = curl_exec($ch);
    curl_close($ch);
    return $data;
}

$url = "https://expoupdate.se/wp-content/uploads/2021/09/Universal-Childrens-Day.jpg";
$raw = getImg($url);
$im = imagecreatefromstring($raw);
$width = imagesx($im);
$height = imagesy($im);
echo $width . " x " . $height;
Çok teşekkür ederim hocam yalnız bir şeyi fark ettim örnek verdiğiniz koddaki görselin boyutları çekiliyor ancak benim sunucudaki bir görselin adresini yazınca çekilemiyor, getimagesize çalışıyormuş oysaki ben test ederken kullandığım görseller engelleniyormuş. Verdiğiniz kod çalışıp kendi sunucumdaki görseli ekleyince çalışmayınca fark ettim.

Mesela şu görselin boyutlarını alamıyorum. https://wisekitten.com/wp-content/uploads/2021/09/logo.png
Şu görselin ise alabiliyorum: https://muratdinc.com/wp-content/uploads/2019/01/photo-light-box.jpg

$logo_size = getimagesize( 'https://expoupdate.se/wp-content/uploads/2021/09/Universal-Childrens-Day.jpg' );
var_dump($logo_size);
Sonuç: array(7) { [0]=> int(1255) [1]=> int(706) [2]=> int(2) [3]=> string(25) "width="1255" height="706"" ["bits"]=> int(8) ["channels"]=> int(3) ["mime"]=> string(10) "image/jpeg" }
$logo_size = getimagesize( 'https://wisekitten.com/wp-content/uploads/2021/09/logo.png' );
var_dump($logo_size);
Sonuç: bool(false)