PHP code example of supasta / fns-service
1. Go to this page and download the library: Download supasta/fns-service 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/ */
supasta / fns-service example snippets
nsService\Factory\FNS;
/**
* If u have simple full name
*/
$fnsResponse = FNS::parse("Иванов Иван", "02.06.1999", "1234 123456")->getInn();
/**
* If u have full name more than 3 words
*/
$fnsResponse = FNS::direct("Галиев", "Шавкат", "Тимур Угли", "02.06.1999", "FA123456")->getInn();
/**
* Check errors and handle it
*/
if ($fnsResponse->hasErrors()) {
var_dump($fnsResponse->getErrors());
} else {
var_dump($fnsResponse->inn);
}