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