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
Which one is best framework for php?
How are sessions maintained?
Do you know what is the function mysql_pconnect() usefull for?
How to write in a file in php?
What is the use of Php variables?
What is strlen function in php?
How to find length of an array in php ?
What is == and === in php?
in PHP for pdf which library used?
What is the actually used php version?
What is isset in php?
What is the use of print_r function in php?
Explain Type hinting in PHP?
What is composer install?
Tell me will a comparison of an integer 12 and a string "13" work in php?