Answer Posted / 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 |
Post New Answer View All Answers
What is php and why it is used?
What is csrf token and how will you add csrf token in ajax?
How to convert a string to uppercase in php?
Why do we need session?
What is needed to be able to use image function?
Tell us what does $_cookie means?
What are the new features available in php 7?
What is the importance of php?
What is the use of strpos in php?
What does isset() function?
How can php and html interact?
What is a closure in php?
What is a http session?
Inside a php function, what param needs to be set in order to access a global variable?
What are Routines?