PHP получить первый символ строки
$firstStringCharacter = substr("hello", 0, 1);
Grepper
$firstStringCharacter = substr("hello", 0, 1);
if(!function_exists('get_avatar')){
function get_avatar($str){
$acronym;
$word;
$words = preg_split("/(\s|\-|\.)/", $str);
foreach($words as $w) {
$acronym .= substr($w,0,1);
}
$word = $word . $acronym ;
return $word;
}
}