I was wondering how can I find the width of an image using php.
Easy, you can use getimagesize:
list($width, $height) = getimagesize($filename);