2017 © Pedro Peláez
 

library dadata-php-sdk-unofficial

A PHP library for the DaData.ru REST API.

image

mesilov/dadata-php-sdk-unofficial

A PHP library for the DaData.ru REST API.

  • Sunday, June 22, 2014
  • by mesilov
  • Repository
  • 1 Watchers
  • 4 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

dadata-php-sdk (unofficial)

A PHP library for the DaData.ru REST API, (*1)

API documentation, (*2)

Example

``` php // init lib require_once('../src/dadata.php');, (*3)

$arDirtyNames = array( 'Иванов Иван Иванонович', 'иванов иван иванович', 'ivanov ivan ivanovich', 'иванов' );, (*4)

$arCleanData = array(); print(', (*5)

');
try
{
    // https://dadata.ru/api/clean/
    $obDaData = new DaData\DaData('YOUR API KEY');
    // normalize names with non - strict mode
    foreach($arDirtyNames as $dirtyData)
    {
        $arCleanData[] = $obDaData->normalizeFullName($dirtyData, false);
    }
    var_dump($arCleanData);

    // normalize name with strict mode
    $arCleanData[] = $obDaData->normalizeFullName($arDirtyNames[0], true);
}
catch (DaData\DaDataException $e)
{
    var_dump($e->getMessage());
    var_dump($e->getTraceAsString());
}
print('

');, (*6)

## Installation ##
Update your composer.json file
``` json
    "require": {
        "mesilov/dadata-php-sdk-unofficial":"dev-master"
    }

Support

email: mesilov.maxim@gmail.com
vk: mesilov.maxim
twitter: @mesilov, (*7)

The Versions

22/06 2014

dev-master

9999999-dev https://github.com/mesilov/dadata-php-sdk-unofficial

A PHP library for the DaData.ru REST API.

  Sources   Download

MIT

The Requires

  • php >=5.2.0
  • ext-json *
  • ext-curl *

 

api php rest dadata