PHP code example of optimaize / nameapi-client-php
1. Go to this page and download the library: Download optimaize/nameapi-client-php 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/ */
optimaize / nameapi-client-php example snippets
use org\nameapi\ontology\input\context\Context;
use org\nameapi\ontology\input\context\Priority;
$context = Context::builder()
->place('US')
->priority(Priority::REALTIME())
->build();
$serviceFactory = new ServiceFactory('your-api-key', $context);
use org\nameapi\ontology\input\entities\person\NaturalInputPerson;
use org\nameapi\ontology\input\entities\person\name\InputPersonName;
$inputPerson = NaturalInputPerson::builder()
->name(InputPersonName::westernBuilder()
->fullname( "John F. Kennedy" )
->build())
->build();