Answers for "get the first letter of string php laravel ucfirst"

PHP
4

laravel uppercase first letter

use Illuminate\Support\Str;

...

$string = Str::ucfirst('foo bar');
Posted by: Guest on August-17-2020
1

laravel get first letter of each word

$words = explode(" ", "Community College District");
$acronym = "";

foreach ($words as $w) {
  $acronym .= $w[0];
}
Posted by: Guest on May-31-2021

Code answers related to "get the first letter of string php laravel ucfirst"

Browse Popular Code Answers by Language