I need to split the first letter from variable $name. How I can to do it?
$name = $userData[\'name\'];
How I can to get the first letter?
$userData['name'][0]
Offsets in strings can be accessed like arrays. Be aware that this assumes your strings are in a single byte encoding. If you have multi-byte encoded strings, you need:
mb_substr($userData['name'], 0, 1, 'UTF-8' /* (the correct encoding) */)