如何获得 Dailymotion 头衔

发布于 2024-12-29 18:39:59 字数 1432 浏览 0 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情丝乱 2025-01-05 18:39:59

问题是您正在返回 JSON 格式,但尝试对其进行反序列化,这应该可以工作:

$imgid = $video_cek["embed"];
$hash = json_decode(file_get_contents("http://www.dailymotion.com/services/oembed?format=json&url=http://www.dailymotion.com/embed/video/$imgid"), true);
$video_cek['baslik']= $hash['title'];

The problem is you are returning JSON Format but trying to unserialize that, this should work:

$imgid = $video_cek["embed"];
$hash = json_decode(file_get_contents("http://www.dailymotion.com/services/oembed?format=json&url=http://www.dailymotion.com/embed/video/$imgid"), true);
$video_cek['baslik']= $hash['title'];
筱果果 2025-01-05 18:39:59

你得到一个 json 响应,所以使用 json_decode 函数来接受 JSON 编码字符串并将其转换为 PHP 变量。

喜欢:

$array = json_decode($hash, true);

echo $array['title'];

$array = json_decode($hash);

echo $array->title;

you get a json response, so use json_decode function to Takes a JSON encoded string and converts it into a PHP variable.

like:

$array = json_decode($hash, true);

echo $array['title'];

or

$array = json_decode($hash);

echo $array->title;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文