Frage

Wie kommt man Breite und Höhe eines Bildes?

Ich habe $variable = 'http://site.com/image.png"

Möchten Sie dieses Bildes $width und Höhe $height bekommen Breite.

Wie: $variable = 'http://site.com/image.png"

$width = '300'; // image width is 300px
$height = '500'; // height is 500px

Danke.

War es hilfreich?

Lösung

$variable = 'http://site.com/image.png';
$image    = getimagesize($variable);
$width    = $image[0];
$height   = $image[1];
$type     = $image[2];

Andere Tipps

getimagesize Funktion. Vielleicht wird es Ihnen helfen.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top