$string = 'Portable Storage Units ';
function initials($str) {
$ret = '';
foreach (explode(' ', $str) as $word)
$ret .= strtoupper($word[0]);
return $ret;
}
$st = initials($string);
echo $st;
Output : PSU
Programing Coderfunda September 05, 2022 Laravel, php No comments
$string = 'Portable Storage Units ';
function initials($str) {
$ret = '';
foreach (explode(' ', $str) as $word)
$ret .= strtoupper($word[0]);
return $ret;
}
$st = initials($string);
echo $st;
Output : PSU
0 comments:
Post a Comment
Thanks