问题
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