PHP code example of faceplusplus / facepp-php-sdk

1. Go to this page and download the library: Download faceplusplus/facepp-php-sdk 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/ */

    

faceplusplus / facepp-php-sdk example snippets




use Fpp\FppClient;

$host = 'https://api-cn.faceplusplus.com';
$apiKey = '<Your Key>';
$apiSecret = '<Your Secret>';

$client = new FppClient($apiKey, $apiSecret, $host);

$data = array(
    'image_url' => "https://www.faceplusplus.com.cn/scripts/demoScript/images/demo-pic10.jpg",
    'return_landmark' => '2',
    'return_attributes' => 'age,headpose'
);

$resp = $client->detectFace($data);
var_dump($resp);