You can use it imagettftext()to write text to images if your host supports GD2 and FreeType (as most servers do). Detailed syntax and comments can be found here:
http://php.net/manual/en/function.imagettftext.php
Find a font (* .ttf or * .otf) that supports Hindi characters. Put the font file in the same directory as your script, and then try this code - replacing "yourhindifont.ttf" with your own font file name:
<?php
$utf8str = "पुलिसवाला आमिर खान";
ob_start();
$im = imagecreatetruecolor(400,40);
$white = imagecolorallocate($im,255,255,255);
imagefilledrectangle($im,0,0,imagesx($im),imagesy($im),$white);
$font = "yourhindifont.ttf";
$color = imagecolorallocatealpha($im, 50, 50, 50, 0);
$size = 20;
$angle = 0;
$x = 5;
$y = imagesy($im) - 5;
imagettftext($im, $size, $angle, $x, $y , $color, $font, $utf8str);
$err = ob_get_clean();
if( !$err ) {
header("Content-type: image/png");
imagepng($im);
} else {
header("Content-type: text/html;charset=utf-8");
echo $err;
}
?>
, UTF-8 ( ) . , .