如何在 php 中访问 youtube 数据 api json 响应 $t 变量? [英] How to access youtube data api json response $t variable in php?

查看:52
本文介绍了如何在 php 中访问 youtube 数据 api json 响应 $t 变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到了来自 YouTube 数据 API 的 JSON 响应.

I'm getting a JSON response from the YouTube Data API.

以下是 Title 变量的示例响应:

Here is a sample response of the Title variable:

标准类对象([$t] => 视频标题)

stdClass Object ( [$t] => Video Title )

如何访问 $t 变量?

How do I access the $t variable?

$blah->$t 不起作用,因为它通过 $t 查找变量,而不是名称为 $t 的 $blah 成员.

$blah->$t won't work because it looks for a variable by $t, and not a member of $blah with name $t.

推荐答案

$blah->{'$t'}

避免SO消息长度限制的消息;)

message to avoid SO message length limit ;)

这篇关于如何在 php 中访问 youtube 数据 api json 响应 $t 变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆