What type of compression/algorithm does imagejpeg() use when compressing an image?
imagejpeg uses the GD library - so the compression / algorithm will be the same as is used with GD.
If you’re ever unsure about a function, you can always look in the manual.