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
Can php run without server?
What is the use of magic function in php?
What are default session time and path?
What are helpers in php?
Which function is used in php to check the data type of any variable?
What's the output of the ucwords function in this example?
How to remove the new line character from the end of a text line in php?
Which function would you use to replace a record in a database in php?
What is lazy loading in php?
Explain what are psrs? Choose 1 and briefly describe it?
Explain what is the function file_get_contents() usefull for?
What are the functions to be used to get the image's properties (size, width and height)?
What is php built on?
Tell me how to initiate a session in php?
Explain which cryptographic extension provide generation and verification of digital signatures?