title: how to rotate image in php?
body: <p>I have a function that generates text that fits the lower part of a circle. Because I do not know any other way that I can make the function fit the upper part of the circle so that it faces me, I want to rotate the image, write on it, rotate it back and again write on it. How can I do that without changing the name of the image?</p>
  
  <p>I have tried something like this :</p>
  
  <pre><code>&lt;?php
  function  create_image()
  {
  
  $im = @imagecreate(140, 140)or die("Cannot Initialize new GD image stream");
  $background_color = imagecolorallocate($im, 255, 255, 255);
  
  imageellipse ( $im , $cx , $cy , $size*2 , $size*2 , $black );
  
  write($im,$cx,$cy,$size,$s,$e,$black,$text1,$font,$size,$pad);
  imagerotate($im, 180,0);
  write($im,$cx,$cy,$size,$s,$e,$black,$text2,$font,$size,$pad);
  imagerotate($im, 180,0);
  
  imagepng($im,"image.png");
  imagedestroy($im);  
  
  }
  ?&gt;
  
  &lt;?php
  create_image();
  print "&lt;img src=image.png?".date("U")."&gt;";
  ?&gt;
  </code></pre>
  
  <p>But it doesn't work. It doesn't rotate the image.</p>
  
  <p>Can you please help me?</p>
  
  <p>Thanx !</p>