get image size from string

getimagesizefromstring function for PHP5.4

$string_image = file_get_contents("image.jpg");
$output = getimagesizefromstring($string_image);

example output is

Array
(
    [0] => 480
    [1] => 532
    [2] => 2
    [3] => width="480" height="532"
    [bits] => 8
    [channels] => 3
    [mime] => image/jpeg
)

Related posts:

This entry was posted in knowledge, php, technology. Bookmark the permalink.