9951 explained code solutions for 126 technologies


php-gdHow to save JPG image to file


$im = imagecreatetruecolor(400, 300);

# ...

imagejpeg($im, '/tmp/image.jpg');ctrl + c
imagecreatetruecolor

creates true color GD image object with specified width & height

imagejpeg

saves $im gd object to the specified 'jpeg' file

/tmp/image.jpg

path to save jpeg to