質問
画像の幅と高さを取得する方法は?
私は持っています $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 働き。多分それはあなたを助けるでしょう。
所属していません StackOverflow