The getimagesize function is used to retrieve the width and height of a given image file. It actually returns an array of 4 elements (the width, height, file type and attributes), but we've discarded the unwanted information.
The dimensions of the new canvas should be larger than the original image by the size of the drop shadow's offset. This way, we won't need to resize or crop the original image later.
The imagecreatetruecolor function creates a new image canvas with the specified dimensions and returns a resource identifier to it.
A note for those who may be familiar with the imagecreate function: imagecreate returns a palette image resource. Since we'll presumably be working with true color images, imagecreatetruecolor is preferred over imagecreate.