I am using this script to generate changing text, how can I make the text always appear centered on the image?
<?php
$text = $_GET["text"];
$imgname = "images/bg.gif";
header("Content-type: image/png");
$im = imagecreatefromgif($imgname);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
$font = 'fonts/neuropolx.ttf';
//This text somehow needs to be centered
imagettftext($im, 10, 0, 15, 15, $grey, $font, $text);
imagettftext($im, 10, 0, 14, 14, $black, $font, $text);
imagepng($im);
imagedestroy($im);
?>