How to save the rotation of an image on server ? : $filename = '01.jpg';
$degrees = 90;

// Content type
header('Content-type: image/jpeg');

// Load
$source = imagecreatefromjpeg($filename);

// Rotate
$rotate = imagerotate($source, $degrees, 0);

// Output
$rotate = imagejpeg($rotate);

I am using this please explain how to update those image 