Can I rotate a image using a php code? Help needed with the php code?

Member Avatar

GD library:

From the manual:

<?php
// File and rotation
$filename = 'test.jpg';
$degrees = 180;

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

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

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

// Output
imagejpeg($rotate);
?>

http://php.net/manual/en/function.imagerotate.php

You need the php.net manual. Download a copy - it'll save you hours of pointless forum posting.