020 555 1111
  • Old fashion, modular, procedural PHP plus some scaffolding techniques to allow it to mimic MVC simplicity.
  • A quick reference to help you find in PHP maze what needs to be done and how to do it.
  • Learn a PHP Object Oriented Programming by building a live discussion forum application.
  • MVC - Model View Controller - real life, easy reference and application.
This product has options, take a look at them and select ones you like the most.
Options are displayed under image section.

PHP getimagesize function
[PHP reference]

 

Get image information in form of an array. 

You require PHP GD Graphics Library.

To check if library is installed, you may use phpinfo(), or 

if (extension_loaded('gd') && function_exists('gd_info'))
	    echo "It looks like GD is installed.<br /><br />";

 

To get more info about Library settings, use this.

var_dump(gd_info());

 

 

output

explanation

image type codes
 
Array
(
    [0] => 256
    [1] => 256
    [2] => 3
    [3] => width="256" height="256"
    [bits] => 8
    [mime] => image/png
)
Array
(
    [width] => 256
    [height] => 256
    [image type] => 3
    [...] => width="256" height="256"
    [bits] => 8
    [mime] => image/png
)
1 = GIF 
2 = JPG 
3 = PNG
4 = SWF
5 = PSD
6 = BMP
7 = TIFF(intel byte order)
8 = TIFF(motorola byte order) 
9 = JPC
10 = JP2
11 = JPX
12 = JB2
13 = SWC
14 = IFF
15 = WBMP
16 = XBM

 

 

usage (basic):

getimagesize($image_source)

 

potential image sources:

$image_source = 'C:\wamp\www\mmvc\resources\img\uploads\image.png';

or

$image_source = '/home/admin/domains/domain.com/public_html/resources/img/uploads/image.png';

or

$src = 'http://mmvc/resources/img/uploads/image.png'