获取字典实用程序列表

示例代码印有国家代码和国家名称,可以很容易地进行修改,从而返回其他任何字典方法的结果。


require('vendor/autoload.php');

use Emis\Http\Client;
use Emis\Document\Api\Proxy\Dictionary;
 
$client = new Client();
$client->setApi(Client::DOCUMENTS_API);
$client->setToken("YOUR_TOKEN");
 
$dictionary = new Dictionary($client);
 
foreach ($dictionary->getCountries() as $country) {
    echo $country->getCode() . " : " . $country->getName() . "\n";
}