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
Explain what are the different errors in php?
What is the use of stripslashes in php?
Is php 7 backwards compatible?
Explain NULL?
What is the use of isset() in php?
How to open a file in php?
How is it possible to know the number of rows returned in the result set?
Does empty check for null?
What is difference between single quotes and double quotes in php?
In php how can you jump in to and out of "php mode"?
What are php expressions?
Why session timeout is important?
Is php closing tag necessary?
Explain me soundex() and metaphone()?
What are php strings?