1 回答

TA貢獻(xiàn)1804條經(jīng)驗(yàn) 獲得超3個(gè)贊
與一些參數(shù)一起使用json_encode可以防止中文字符的變形。
header('Content-Type: text/html; charset=utf-8');
require ("vendor/autoload.php");
use Vimeo\Vimeo;
$client = new Vimeo("{client_id}", "{client_secret}", "{access_token}");
$video_id ="xxxxx";
$response = $client->request("/videos/$video_id");
//var_dump($response['body']);
if($response['status'] === 200){
header('Content-Type: application/json');
echo json_encode($response['body'], JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
}
else {
echo json_encode($response['body']['error']);
}
- 1 回答
- 0 關(guān)注
- 199 瀏覽
添加回答
舉報(bào)