$string = 'Hello Word '
function initials($str) {
$ret = '';
foreach (explode(' ', $str) as $word)
$ret .= strtoupper($word[0]);
return $ret;
}
$st = initials($string);
OutPut : HW
Programing Coderfunda September 05, 2022 Laravel, php No comments
$string = 'Hello Word '
function initials($str) {
$ret = '';
foreach (explode(' ', $str) as $word)
$ret .= strtoupper($word[0]);
return $ret;
}
$st = initials($string);
OutPut : HW
0 comments:
Post a Comment
Thanks