PHP code example of hanson / face

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

    

hanson / face example snippets



$face = new \Hanson\Face\Foundation\Face();

$result = $face->score->get('https://ws2.sinaimg.cn/large/685b97a1gy1fehkmbi6hvj20u00u07ab.jpg');

/**

[
    'score' => 6.8,
    'text' => '哥们颜值才6.8分,一下让整体颜值从7.3跌到7.1ORZ',
    'url' => 'http://mediaplatform.trafficmanager.cn/image/fetchimage?key='
];

**/


$face = new \Hanson\Face\Foundation\Face();

// 获取颜值实例
$instance = $face->score;

// 获取受欢迎实例
$instance = $face->popular;

// 获取关系实例
$instance = $face->relation;

// 获取请客实例
$instance = $face->bill;

// 获取时尚穿衣实例
$instance = $face->clothing;

// 获取赋诗实例
$instance = $face->poem;

// 所有实例均有一个方法 get
$result = $instance->get($url);