我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

php json解码curl_exec在Facebook上共享链接的结果

I use curl php to share link on facebook all is fine and I'VE got this result { "id": "the_link_id" }. I tried to got the id with:

$result = curl_exec($ch);
$json = json_decode($result);
$post_id = $json->{'id'};
echo $post_id;

but I got this error:

Trying to get property of non-object ...

i found the solution i just added curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

近期文章

  • 在echo中插入数组[关闭]
  • 长期民意调查造成巨大延迟[关闭]
  • 拿网址并解析其中的一部分[重复]
  • 使用PHP使用用户输入填充URL字段
  • 为特定网站制作php文件功能
  • jquery数据表按字母顺序添加新行
  • Love you Ten thousand years 的编写
  • Find a way 寻找方式的问题
  • Cry,men,not crime 怎么来做的
  • Tears of lonely star 怎么写的
  • Say love to you once again 的解法求助
  • 从小到大的顺序输出这三个字符
  • 给你一个整数区间[a,b],请你求出该区间的x使g(x)最大
  • 棋盘分割 正确解法
  • Python 创建Dog类时 报错AttributeError: 'Dog' object has no attribute 'sit'
  • 为什么用gets函数会自动加一个空格?
  • 有人可以解释这些if语句的含义吗? [关闭]
  • 发送电子邮件给用户也在php中输入他/她的详细信息
  • .repsonseText返回空字符串
  • 刷新时插入MySQL数据库的空白数据

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华