getimagesize
image_type_to_extension
GD- und Image-Funktionen
PHP Manual

# getimagesizefromstring

(PHP 5 >= 5.4.0)

getimagesizefromstring — Get the size of an image from a string

### Beschreibung

array getimagesizefromstring ( string `$imagedata` [, array `&$imageinfo` ] )

Identical to getimagesize() except that getimagesizefromstring() accepts a string instead of a file name as the first parameter.

See the getimagesize() documentation for details on how this function works.

### Parameter-Liste

`imagedata`

  The image data, as a string.

`imageinfo`

  See getimagesize().

### Rückgabewerte

See getimagesize().

### Beispiele

Beispiel #1 getimagesizefromstring() 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);
?>`

### Siehe auch

- getimagesize() - Ermittelt die Größe einer Grafik

getimagesize
image_type_to_extension
GD- und Image-Funktionen
PHP Manual