PHP code example of smartdog23 / php-azure-face-api

1. Go to this page and download the library: Download smartdog23/php-azure-face-api 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/ */

    

smartdog23 / php-azure-face-api example snippets



$azureFaceApi = new AzureFaceApi('YOUR_KEY', AzureRegions::EAST_US);
$result = $azureFaceApi->largePersonGroup()->create()->execute('test-group', 'description of the group');

echo $result->getBody()->getContents();


$azureFaceApi = new AzureFaceApi('YOUR_KEY', AzureRegions::EAST_US);
$result = $azureFaceApi->largePersonGroup()->create()->execute('test-group', 'description of the group');

echo $result->getBody()->getContents();


$azureFaceApi = new AzureFaceApi('YOUR_KEY', AzureRegions::EAST_US);

$options = new CreateOptions();
$options->parameters()->largePersonGroupId('test-group');
$options->body()->name('description of the group');
$result = $azureFaceApi->largePersonGroup()->create()->executeWithOptions($options);
echo $result->getBody()->getContents();