简体   繁体   中英

Display text from a json decoded array

  Array
(
    [statuses] => Array
        (
            [0] => Array
                (
                    [metadata] => Array
                        (
                            [result_type] => recent
                            [iso_language_code] => en
                        )

                    [created_at] => Thu Jul 03 08:06:24 +0000 2014
                    [id] => 484609084809687043
                    [id_str] => 484609084809687043
                    [text] => RT @RashtrapatiBhvn: #Rains at the #RashtrapatiBhavan http://t.co/w1imlVFbHe
                    [source] => Twitter Web Client
                    [truncated] => 
                    [in_reply_to_status_id] => 
                    [in_reply_to_status_id_str] => 
                    [in_reply_to_user_id] => 
                    [in_reply_to_user_id_str] => 
                    [in_reply_to_screen_name] => 
                    [user] => Array
                        (
                            [id] => 1620882618
                            [id_str] => 1620882618
                            [name] => HinduNationalist#HDL
                            [screen_name] => hinduwarrior15
                            [location] => HINDUSTAN
                            [description] => I want  India to become a exclusive  Hindurashtra. Want a HINDUSTAN by hindus for hindus and to hindus. HINDU NATIONALIST.. #HDL
                            [url] => http://t.co/hWAAfdlWMX
                            [entities] => Array
                                (
                                    [url] => Array
                                        (
                                            [urls] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [url] => http://t.co/hWAAfdlWMX
                                                            [expanded_url] => http://www.hdlindia.org/
                                                            [display_url] => hdlindia.org
                                                            [indices] => Array
                                                                (
                                                                    [0] => 0
                                                                    [1] => 22
                                                                )

                                                        )

                                                )

                                        )

This is typical result I get from calling the Twitter API, but I just want to display id and text from this. I have already decoded the incoming json result using json_decode method.

I have never used a json string, it will be great if anyone could help

Please help

$yourArray['statuses'][0]['id']$yourArray['statuses'][0]['text']应该可以解决问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM