PHP Questions Home
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

how to rotate an image using php code?


There is a function within PHP called imagerotate that will do this for you.

So if for instance you want to rotate an image by 90 degrees, you can use:

<?php
$move90 
imagerotate($myimage,90);
//$myimage is the reference to the loaded image, eg through imagecreatefromjpeg
?>


...Then just output that image as you would normally with, for instance, imagejpeg() and there you go!

Comments on this Question/Answer

How can i set the image path to variable $myimage. how i include tag into that code..
By: anu, 21 Sep 2009 06:25:44



Reply to comments / post your own comment >>>

ASK A QUESTION

More images PHP Questions

How can I rotate an image?

How can I add text to an image?

I have a text query, but I added images (small jpgs), I am not sure but it looks like it is creating/saving the files in a tmp folder each time a visitor requests the query. Is there a efficient way to run a query calling images? I noticed some PHP progr

How can I find the colour of a pixel of an image?

how can i load images with php?



Custom Search