การหมุนภาพ

ตัวอย่างการหมุนภาพ (Rotate)

ไฟล์ code/image/rotate.php

<?php
header('Content-Type: image/jpeg');
if(is_numeric($_GET['angle']))$angle=$_GET['angle'];else $angle=0;
$im = imagecreatefromjpeg('https://phpmysql.khonsongkhla.com/img/html/bootstrap-pic/MzHy4.jpg');
$im = imagerotate($im, $angle, 0);
imagejpeg($im, null);
imagedestroy($im);
?>

คำสั่ง html
<img src="/code/php/rotate.php?angle=30">
ผลลัพธ์

<img src="/code/php/rotate.php?angle=90">
ผลลัพธ์

<img src="/code/php/rotate.php?angle=180">
ผลลัพธ์

<img src="/code/php/rotate.php?angle=-45">
ผลลัพธ์