imagerotate($source_image,$angle,$bg_color,$int_transparent)
$source_image : Image resource created before<?Php
header ("Content-type: image/jpg");
$file_name='../images/top2.jpg'; // Image collected
$angle='180'; // Angle of rotation is set
$img_source = imagecreatefromjpeg($file_name); // Image created
$img_rotated = imagerotate($img_source, $angle, 0); // Rotate the image
imagejpeg($img_rotated); // Output Displayed
imagedestroy($img_source); // Free the memory
imagedestroy($img_rotated); // Free the memory
?>
Above code is saved as gd-imagerotate-demo.php and displayed in this page, HTML code is here.
<img src=gd-imagerotate-demo.php>
GD functions in PHP for handling images & graphics
How to check GD support in PHP