使用循环解析 Facebook API 数据以获取粉丝页面 ID#s?
我一直在学习如何解析从 facebook->api 返回的 json 数据。我已经弄清楚如何从特定的个人资料 ID 中获取粉丝页面,并希望使用循环来解析它们!
下面是我的代码和示例:
这是我从 facebook->api 返回的数据,
Array ( [0] => Array (
[page_id] => XXXXXX60828 ) [1] => Array (
[page_id] => XXXXXX0750 ) [2] => Array (
[page_id] => XXXXXX91225 ) [3] => Array (
[page_id] => XXXXXX1960343 ) [4] => Array (
[page_id] => XXXXXX60863 ) [5] => Array (
[page_id] => XXXXXX8582 ) )
我需要能够将此数据放入循环中并提取 page_id#s ......仍然熟悉 json在解决这个问题时遇到问题吗?
我怎样才能在循环中使用 foreach 并去掉页面 id#s?
I've been learning how to parse json data returned from the facebook->api. I've figured out how to fetch fan pages from a specific profile id and want to parse them using a loop!
Heres the code and example I have below:
This is the data I get back from the facebook->api
Array ( [0] => Array (
[page_id] => XXXXXX60828 ) [1] => Array (
[page_id] => XXXXXX0750 ) [2] => Array (
[page_id] => XXXXXX91225 ) [3] => Array (
[page_id] => XXXXXX1960343 ) [4] => Array (
[page_id] => XXXXXX60863 ) [5] => Array (
[page_id] => XXXXXX8582 ) )
I need to be able to put this data in a loop and extract the page_id#s out... still getting familiar with json and am having issues figuring this out?
How can I get this in a loop using for each and strip out the page id#s?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么不直接使用您拥有的数组:
Why not just use the array you've got: