How can I write Non English Characters such as Arabic or Persian characters into an image?
问题 How can I write Arabic or Persian characters to an image using PHP GD library? i.e. "احسان" 回答1: Use this function in order to pass text to imagettftext <?php function revUni($text) { $wordsArray = explode(" ", $text); $rtlCompleteText=''; for ($i = sizeOf($wordsArray); $i > -1; $i = $i-1) { //$lettersArray = explode("|", str_replace(";|", ";", $wordsArray[$i])); $lettersArray = explode(";", $wordsArray[$i]); $rtlWord=''; for ($k = sizeOf($lettersArray); $k > -1; $k = $k-1) { if (strlen(