If conditions with hebrew letter [duplicate]

浪尽此生 提交于 2019-12-25 20:28:04

问题


Possible Duplicate:
Split the first letter from variable

i have code:

if($firstletter=='I')
{
     $picture = ImageCreateFromPNG ($global['maleBackgroundImages'][5]);
}
else
{
     $picture = ImageCreateFromPNG ($global['maleBackgroundImages'][4]);
}

If I want to change the 'I' to hebrew letter how I do it? and if I want to check range

$firstletter>a **and** $firstletter<b 

how I do it in the if?


回答1:


Assuming UTF-8 character set

$firstletter = mb_substr($userData['name'], 0, 1, 'UTF-8');
if ($firstletter=='א') {
    ...
}

or modify for the appropriate character set



来源:https://stackoverflow.com/questions/13859052/if-conditions-with-hebrew-letter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!