This function does not require the
GD image library.
Included in this section for being in common use.
This function returns, directly, the size of any supported given image file and return the dimensions along with the file type and a height/width text string to be used inside a normal HTML IMG tag and the correspondent HTTP content type.
Additionally can also return some more information in
$image_info parameter passed as reference.
This function expects
$string to be a valid string image file.
If a non-image file is supplied, it may be incorrectly detected as an image and the function will return successfully, but the array may contain nonsensical values.
You should not use this function to check that a given file is a valid image; there are other functions to do this.
This function is identical to
getimagesize except that accepts a string instead of a file name as the first parameter.
STREAM WRAPPERS |
MEANING |
file:// |
LOCAL File System |
http:// |
URL HTTP |
ftp:// |
URL FTP |
php:// |
I/O streams |
zlib:// |
Data Compression stream |
data:// |
DATA (RFC-2397) |
glob:// |
Find Filenames |
phar:// |
PHP Archive |
ssh2:// |
Secure Shell 2 |
rar:// |
RAR |
ogg:// |
Audio |
expect:// |
Interaction of stream processes |
ed48 |
$image_info is the optional parameter that allows to extract some extended information from the image file.
There are other functions which display such information in more detail, if available, in JPEG files.
<?php
array|false getimagesizefromstring( string $string, array &$image_info = null )
where,
$string = The image data as string
&$image_info = The extended information
from the image string file
( PASSED as reference )
?>