How can I write diagonal text in PHP <p>I want to import some timestamps from a table and I want to write them diagonal under the graph. How can I do that?</p> <p>here is my code, but not for the import data.</p> <pre><code>header("Content-type: image/png"); $img = imagecreate(100, 75); $bg = imagecolorallocate($img, 255, 255, 0); $black = imagecolorallocate($img, 0, 0, 0); $roles = array('anoniem', 'ingelogd', 'leerling', 'docent', 'rector'); $left = 0; foreach ($roles as $role) { imagestring ($img, 2, 0, $left, $role, $black); $left+= 15; } $img2 = imagerotate($img, 45, $bg); imagedestroy($img); imagepng($img2); </code></pre>