GETIMAGESIZEFROMSTRING(3) 1 GETIMAGESIZEFROMSTRING(3)getimagesizefromstring - Get the size of an image from a stringSYNOPSIS
array getimagesizefromstring (string $imagedata, [array &$imageinfo])
DESCRIPTION
Identical to getimagesize(3) except that getimagesizefromstring(3) accepts a string instead of a file name as the first parameter.
See the getimagesize(3) documentation for details on how this function works.
PARAMETERS
o $imagedata
- The image data, as a string.
o $imageinfo
- See getimagesize(3).
RETURN VALUES
See getimagesize(3).
EXAMPLES
Example #1
getimagesizefromstring(3) example
<?php
$img = '/path/to/test.png';
// Open as a file
$size_info1 = getimagesize($img);
// Or open as a string
$data = file_get_contents($img);
$size_info2 = getimagesizefromstring($data);
?>
SEE ALSO getimagesize(3).
PHP Documentation Group GETIMAGESIZEFROMSTRING(3)