0

画像の幅と高さを取得するには?

私は持っている$variable = 'http://site.com/image.png"

この画像の幅$widthと高さをに取得したい$height

お気に入り: $variable = 'http://site.com/image.png"

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

ありがとう。

4

2 に答える 2

2
$variable = 'http://site.com/image.png';
$image    = getimagesize($variable);
$width    = $image[0];
$height   = $image[1];
$type     = $image[2];
于 2010-08-18T08:53:43.167 に答える
1

getimagesize関数。多分それはあなたを助けるでしょう。

于 2010-08-18T08:46:07.240 に答える