Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
PHPで画像サイズを取得する
$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