I have a custom field 'first_name' created by ACF advanced custom fields. I use this code to get the value from the field: the out put would be something like Mark. What I need exactly is getting only the first letter from the first name. I tried to use
$string = the_field('first_name'); echo $string;
$string = the_field('first_name'); echo substr($string, 0, 1);
$myStr = the_field('first_name'); $result = substr($myStr, 0, 1); echo $result;
but both methods give the full name not only the first letter. Any suggestions please?