Answers for "php get first letter of each word"

PHP
2

php function to convert string to camelcase

echo ucwords("hello world");
Posted by: Guest on May-15-2020
0

php get first character of each word

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;
    }
}
Posted by: Guest on August-30-2021

Code answers related to "php get first letter of each word"

Browse Popular Code Answers by Language