note 97767 deleted from function.imagettftext by cmb
| From: | cmb@php.net | Date: | Tue, 13 Sep 2016 17:14:14 +0000 |
| Subject: | note 97767 deleted from function.imagettftext by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-206572@lists.php.net to get a copy of this message | ||
Note Submitter: Amir
----
In order to pass text of RTL language to imagettftext function, I used this function.
<?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($lettersArray[$k]) > 1) { // make sure its full unicode letter
$rtlWord = $rtlWord."".$lettersArray[$k].";";
}
}
$rtlCompleteText = $rtlCompleteText." ".$rtlWord;
}
return $rtlCompleteText;
}
?>