Created
October 31, 2014 02:35
-
-
Save kamichimo/af6c062f81c4397e4318 to your computer and use it in GitHub Desktop.
PHPで画像サイズを取得する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$imagesize = getimagesize('画像のURL'); | |
if($imagesize){ | |
echo $imagesize[0]; // width | |
echo $imagesize[1]; //height | |
echo $imagesize[2]; //画像の種類 | |
echo $imagesize[3]; //サイズの文字列(width="X" height="Y") | |
}else{ | |
echo 'データ取得失敗...'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment