03-04-2006, 13:31
|
|
|
חבר מתאריך: 03.07.05
הודעות: 284
|
|
גם זה נפתר בעזרת הפונקציה STRREV(שלא תומכת בUTF8 אבל מצאתי פונקציה שכן תומכת)
תודה על העזרה ולהלן הקוד האחרון:
קוד PHP:
<?php function utf8_strrev($str){ preg_match_all('/./us', $str, $ar); return join('',array_reverse($ar[0])); } // create a 100*30 image $im = imagecreatefromjpeg("moo2.jpg");
// white background and blue text $bg = imagecolorallocate($im, 255, 255, 255); $textcolor = imagecolorallocate($im, 0, 0, 0); $font = "Arial.ttf"; // write the string at the top left $text=utf8_strrev($_GET['text']); $x=550; $bbox=imagettfbbox(20, 0, $font, $text); $textWidth = $bbox[2] - $bbox[0]; $x -= $textWidth; imagettftext($im, 20, 0, $x, 87, $black, $font, $text);
// output the image header("Content-type: image/png"); imagepng($im); ?>
|