There is a lot of things that we want to do with in less time and working properly. Lets take an example to resize an image, for doing this first of all we need an image edit software and then open that image and resize and at the last save. That will take a lot of time, I am not talking here about image editing software or how to edit an image. I am talking about how to resize an image with php. Obvisioly if you want to edit an image then Adobe Family’s products are far batter whose provide you a lot of functionality.
Now lets come to the point, Before starting let i tell you a bit about this image resizing class. First of all we need to verify an image means get the file extension and check whether it is an image or not. I allow only .jpeg, .jpg, .gif, .png files. After that we have to check the image size, then set the image width and height according to real image, so that the quality of an image remain same, means not stretch when we resize it. Then simply genrate a new image that’s it.