PHP code example of oblak / vocative

1. Go to this page and download the library: Download oblak/vocative 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/ */

    

oblak / vocative example snippets




use Oblak\Vocative\Vocative;

$firstName = 'Avram';
$vocative = new Vocative();

echo $vocative->make($firstName); // Outputs: Avrame




use Oblak\Vocative\Vocative;
use Oblak\Vocative\NullDictionary;

$firstName = 'Aleksandar';
$vocative = new Vocative();

echo $vocative->make($firstName);                                       // Outputs: Aleksandre
echo $vocative->withDictionary(new NullDictionary())->make($firstName); // Outputs: Aleksandare