/ Published in: PHP
Just a rework of http://snipplr.com/view/7523/ with an added switch to change type number to extention name.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* 1 = GIF 5 = PSD 9 = JPC 13 = SWC 2 = JPG 6 = BMP 10 = JP2 14 = IFF 3 = PNG 7 = TIFF(intel byte order) 11 = JPX 15 = WBMP 4 = SWF 8 = TIFF(motorola byte order) 12 = JB2 16 = XBM */ switch($type) { case 1: $typex = 'GIF'; break; case 2: $typex = 'JPG'; break; case 3: $typex = 'PNG'; break; case 4: $typex = 'SWF'; break; case 5: $typex = 'PSD'; break; case 6: $typex = 'BMP'; break; case 7: $typex = 'TIFF(intel byte order)'; break; case 8: $typex = 'TIFF(motorola byte order)'; break; case 9: $typex = 'JPC'; break; case 10: $typex = 'JP2'; break; case 11: $typex = 'JPX'; break; case 12: $typex = 'JB2'; break; case 13: $typex = 'SWC'; break; case 14: $typex = 'IFF'; break; case 15: $typex = 'WBMP'; break; case 16: $typex = 'XBM'; break; } echo 'Width: ' . $width . '<br />Height: ' . $height . '<br />Type: ' . $typex . '<br />Attribute: ' . $attr;