Facebook Stream.Get -- How to access data in array?

Posted by user316841 on Stack Overflow See other posts from Stack Overflow or by user316841
Published on 2010-04-22T21:32:11Z Indexed on 2010/04/22 21:43 UTC
Read the original article Hit count: 273

Filed under:
|
|
|
|

On stream.get, I try to

echo $feeds["posts"][$i]["attachment"]["href"];

It return the URL, but, in the same array scope where "type" is located (which returns string: video, etc), trying $feeds["posts"][$i]["attachment"]["type"] returns nothing at all!

Here's an array through PHP's var_dump: http://pastie.org/930475

So, from testing I suppose this is protected by Facebook? Does that makes sense at all?

Here it's full: http://pastie.org/930490, but not all attachment/media/types has values.

It's also strange, because I can't access through [attachment][media][href] or [attachment][media][type], and if I try [attachment][media][0][type] or href, it gives me a string offset error.

["attachment"]=> array(8) {
    ["media"]=> array(1) {
        [0]=> array(5) {
            ["href"]=> string(55) "http://www.facebook.com/video/video.php?v=1392999461587"
            ["alt"]=> string(13) "IN THE STUDIO"
            ["type"]=> string(5) "video"

My question is, is this protected by Facebook? Or we can actually access this array position?

© Stack Overflow or respective owner

Related posts about php

Related posts about api