画像の幅と高さを取得するには?
私は持っている$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
ありがとう。
$variable = 'http://site.com/image.png';
$image = getimagesize($variable);
$width = $image[0];
$height = $image[1];
$type = $image[2];
getimagesize関数。多分それはあなたを助けるでしょう。