PHP 8.3.4 Released!

getimagesizefromstring

(PHP 5 >= 5.4.0, PHP 7, PHP 8)

getimagesizefromstringDizgedeki görüntünün boyutunu döndürür

Açıklama

getimagesizefromstring(string $dizge, array &$görüntü_bilgisi = null): array|false

İlk bağımsız değişken olarak dosya ismi yerine bir dizge kabul etmesi dışında getimagesize() işlevi gibidir.

İşlevin nasıl çalıştığı hakkında bilgi için getimagesize() belgesine bakılabilir.

Bağımsız Değişkenler

dizge

Dizge olarak görüntü bilgisi.

görüntü_bilgisi

Bkz: getimagesize()

Dönen Değerler

Bkz: getimagesize()

Örnekler

Örnek 1 - getimagesizefromstring() örneği

<?php
$img
= '/path/to/test.png';

// bir dosya olarak aç
$size_info1 = getimagesize($img);

// Bir dizge olarak aç
$data = file_get_contents($img);
$size_info2 = getimagesizefromstring($data);
?>

Ayrıca Bakınız

add a note

User Contributed Notes 2 notes

up
21
imageman
10 years ago
getimagesizefromstring function for < 5.4

<?php
if (!function_exists('getimagesizefromstring')) {
function
getimagesizefromstring($string_data)
{
$uri = 'data://application/octet-stream;base64,' . base64_encode($string_data);
return
getimagesize($uri);
}
}
?>
up
3
sarah at anigel dot net
10 years ago
Just a quick comment on the solution by imageman for versions < 5.4 you will need to enable allow_url_fopen in order to use the data wrapper.
To Top