I am trying to build a function that converts a string to an underlined one. It works on english string but not on hebrew string.
This is the function:
function underline($str){
$tmp_word = '';
foreach(str_split($str) as $char){
$tmp_word.= $char.'̲';
}
return $tmp_word;
}
And some cases:
echo underline('abcd') . "<br>";
$hebrew_word = 'אבגד';
echo underline($hebrew_word) . "<br>";
echo underline( hebrev(iconv("UTF-8", "ISO-8859-8", $hebrew_word))). "<br>";
echo underline(iconv("ISO-8859-8", "UTF-8", hebrev(iconv("UTF-8", "ISO-8859-8", $hebrew_word)))). "<br>";
The output is:
a̲b̲c̲d̲
�̲�̲�̲�̲�̲�̲�̲�̲
�̲�̲�̲�̲
�̲�̲�̲�̲�̲�̲�̲�̲
Is there a solution?