PHP code example of koenhendriks / laravel-str-acronym

1. Go to this page and download the library: Download koenhendriks/laravel-str-acronym library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

koenhendriks / laravel-str-acronym example snippets


'providers' => [
    KoenHendriks\StrAcronym\StrServiceProvider::class,
],

use Illuminate\Support\Str;

$acronym = Str::acronym('Hello World'); // Returns 'HW'

use Illuminate\Support\Str;

$acronym = Str::of('hello world')->headline()->acronym(); // Returns 'HW'

use Illuminate\Support\Str;

$acronym = Str::acronym('Hello World', '.'); // Returns 'H.W.'
$acronym = Str::of('hello world')->headline()->acronym(); // Returns 'H.W.'