PHP code example of asplekhanov / russian-fullname-formatter

1. Go to this page and download the library: Download asplekhanov/russian-fullname-formatter 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/ */

    

asplekhanov / russian-fullname-formatter example snippets


  

use Asplekhanov\RussianFullnameFormatter\RFFormatter;

$arFullname = [
    "LAST_NAME" => "Иванов",
    "NAME" => "Петр",
    "SECOND_NAME" => "Викторович"
];
$sFormat = "#LAST_NAME# #NAME_SHORT# #SECOND_NAME_SHORT#";

$formatter = new RFFormatter();  
echo $formatter->formattingFullname($arFullname, $sFormat); // Иванов П. В.