Good Morning, I am trying to show the Initials of First and Last name but no luck. Tried to use substr () but no luck say Mr. abc xyz = should be shown as AX
thanks in advance,
substr ('Mr. abc xyz' , 1 ); ?>"
Good Morning, I am trying to show the Initials of First and Last name but no luck. Tried to use substr () but no luck say Mr. abc xyz = should be shown as AX
thanks in advance,
substr ('Mr. abc xyz' , 1 ); ?>"
$str = 'Mr. abc xyz';
$arr = explode(' ', $str);
$arr = array_map(fn ($el) => rtrim($el, '.'), $arr);
echo $arr[1][0] . $arr[2][0];
but it is very bad example. If format will be change yu can get a very big problems)