When using the same web page for both the desktop and mobile version, should I create two images, one for the desktop and one for mobile, or should I just have one image, and then resize it using PHP for the mobile version? And how does that affect the size (in bytes) of the image file?
I would create two images. Resizing with PHP on every view adds server overhead. (You could of course write a script to resize each image only once and store the resized version separately until the original was modified again.)
And how does that affect the size (in bytes) of the image file?
Not sure I understand the question. If you're asking how dimensions affect image file size, the answer is plenty - but exactly how much depends on the original size and the target size.
Just create 2 images. That will be faster.
Resizing the images can have a big effect. It depends on how much you resize it and on the speed of the internet connection that you are using.