How can I rotate an image?
Answer / jude jeevanraj.p
Probably not something you will want to do a lot of in
ordinary day PHP use, but if you want to rotate an image
use the well-named imagerotate function.
This takes the image to rotate, the angle of rotation, and
a color to fill the blank space around the rotated image
with.
Here's an example:
<?php
$original = imagecreatefrompng("myimage.png");
$red = imageColorAllocate($original,255,0,0);
imagerotate($original,50,$red);
header("content-type:image/png");
imagepng($rotated);
imagedestroy($original);
imagedestroy($rotated);
?>
| Is This Answer Correct ? | 5 Yes | 0 No |
How to protect special characters in query string?
What is the integer?
What is difference between include and include_once in php?
What is a php session?
What is the use of limit in mysql?
What is php session and how it works?
What is php dependency injection?
How to redirect https to http url and vice versa in .htaccess?
Tell me what is the definition of a session?
What is the difference between get and post method in php?
What is php rest api?
Explain Traits in PHP?