PHP code example of reinerttomas / czech-vocative

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

    

reinerttomas / czech-vocative example snippets


use ReinertTomas\CzechVocative\CzechName;

CzechName::of('Petr')->vocative();     // 'Petře'
CzechName::of('Novák')->vocative();    // 'Nováku'
CzechName::of('Adriana')->vocative();  // 'Adriano'

use ReinertTomas\CzechVocative\CzechName;
use ReinertTomas\CzechVocative\Gender;

$name = CzechName::of('  petr ');

$name->nominative();  // 'Petr'
$name->vocative();    // 'Petře'
$name->gender();      // Gender::Male
(string) $name;       // 'Petr'

CzechName::of('Nováková', gender: Gender::Female, isSurname: true)->vocative();
// 'Nováková'

CzechName::of('Petra', isSurname: false)->vocative();
// 'Petro'