Resize the image using PHP from an external image URL


I'm creating a web app that allows users to specify an image url to display an image along with their submission.

To avoid some potentially large images and odd sizes, i'd like to use PHP to limit/resize the image before it gets output to the browser (I know i could use max-width in CSS but this is unnecessary downloading)

Is this possible?

PHP has a library named GD. It's fairly easy to check the size of an image with the getimagesize() function.