Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mesilov/dadata-php-sdk-unofficial
A PHP library for the DaData.ru REST API
https://github.com/mesilov/dadata-php-sdk-unofficial
Last synced: 15 days ago
JSON representation
A PHP library for the DaData.ru REST API
- Host: GitHub
- URL: https://github.com/mesilov/dadata-php-sdk-unofficial
- Owner: mesilov
- License: mit
- Created: 2014-06-14T12:16:37.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-06-22T09:05:04.000Z (over 10 years ago)
- Last Synced: 2024-03-15T00:02:21.541Z (10 months ago)
- Language: PHP
- Size: 176 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
dadata-php-sdk (unofficial)
=========================A PHP library for the DaData.ru REST API
[API documentation](https://dadata.ru/api/clean/)
## Example ##
``` php
// init lib
require_once('../src/dadata.php');$arDirtyNames = array(
'Иванов Иван Иванонович',
'иванов иван иванович',
'ivanov ivan ivanovich',
'иванов'
);$arCleanData = array();
print('');');
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('
```
## Installation ##
Update your composer.json file
``` json
"require": {
"mesilov/dadata-php-sdk-unofficial":"dev-master"
}
```
## Support ##
email:
vk: [mesilov.maxim](https://vk.com/mesilov.maxim)
twitter: [@mesilov](https://twitter.com/mesilov)