我需要从变量 $name 中拆分第一个字母。我该怎么做?
$name = $userData['name'];
我怎样才能得到第一个字母?
请检查它是否正确:
if($userData['gender'] == 'male'){
if($firstletter=='i'){
$picture = ImageCreateFromPNG ($global['maleBackgroundImages'][1]);
}else{
$picture = ImageCreateFromPNG ($global['maleBackgroundImages'][2]);}
}else{
if($firstletter=='i'){
$picture = ImageCreateFromPNG ($global['maleBackgroundImages'][1]);
}else{
$picture = ImageCreateFromPNG ($global['maleBackgroundImages'][2]);}
}