$file = $forumpath."image.php?u=$userid"; list($width, $height, $type) = getimagesize($file); if ($width == 1){ //User has no avatar }