PHP GD Image View

GD Image View

<?
$image = "test.png";

$type = exif_imagetype($image);

display($image,$type);

function display($image,$num) {
  if ($num == 1) { $create = imagecreatefromgif($image); imagegif($create); }
  if ($num == 2) { $create = imagecreatefromjpeg($image); imagejpeg($create); }
  if ($num == 3) { $create = imagecreatefrompng($image); imagepng($create); }
  if ($num == 7) { $create = imagecreate($image); image($create); }
}
?>