Penggunaan fungsi CURL pada PHP

Jadi saya memiliki tautan yang mengembalikan objek JSON, dan saya perlu mendekodekannya dan memasukkannya ke dalam variabel-variabel dalam PHP. 

URL

api.php?action=getThreads&hash=123fajwersa&node_id=4&order_by=post_date&order=desc&limit=1&grab_content&content_limit=1

Ini adalah objek yang dikembalikannya 

{
    "count": 1,
    "threads": {
        "38752": {
            "thread_id": 38752,
            "node_id": 4,
            "title": "The ShadyCraft Beta Launch!",
            "reply_count": 45,
            "view_count": 946,
            "user_id": 2,
            "username": "Shady",
            "post_date": 1366956695,
            "sticky": 0,
            "discussion_state": "visible",
            "discussion_open": 1,
            "discussion_type": "",
            "first_post_id": 226167,
            "first_post_likes": 7,
            "last_post_date": 1369094302,
            "last_post_id": 228226,
            "last_post_user_id": 2,
            "last_post_username": "Shady",
            "prefix_id": 19,
            "tinhte_xentag_tags": "a:4:{i:0;s:9:\"minecraft\";i:2;s:4:\"news\";i:3;s:14:\"private server\";i:1;s:10:\"shadycraft\";}",
            "content": {
                "count": 1,
                "content": {
                    "226167": {
                        "post_id": 226167,
                        "thread_id": 38752,
                        "user_id": 2,
                        "username": "Shady",
                        "post_date": 1366956695,
                        "message": "[ATTACH=full]4143[\/ATTACH]\n \nWe've completely restructured ShadyCraft, and today will be the launch of the ShadyCraft beta.\n \nCurrent Features\n[LIST]\n[*]Towns\n[*]Nations\n[*]All out wars\n[*]A live update map\n[*]No White-list\n[*]Earn Money\n[*]Griefing allowed where possible\n[\/LIST]\nThese are just some features which have a lot more things behind them. For instance, there is town and nation upkeep, tax, kingdoms, mayors, and kings.\n \nWe really wanted to have the server self-governed and this is why griefing and PvP are allowed where ever they are possible. All towns and nations cannot be griefed by other members. You can create a town and buy plots for it and expand the town as you wish.\n \n[SIZE=4]All of this is shown in the live updating map located [URL='http:\/\/50.7.6.116:8123']here[\/URL].[\/SIZE]\n \n[SIZE=4][SIZE=6]Join the Beta Now[\/SIZE][\/SIZE]\n[SIZE=6]Server-IP: 50.7.6.116[\/SIZE]\n \n \n[USER=118053]Frenchy[\/USER] and [USER=4863]Wolfbane[\/USER]",
                        "ip_id": 747429,
                        "message_state": "visible",
                        "attach_count": 1,
                        "position": 0,
                        "likes": 7,
                        "like_users": "a:5:{i:0;a:2:{s:7:\"user_id\";i:105699;s:8:\"username\";s:6:\"kvothe\";}i:1;a:2:{s:7:\"user_id\";i:146724;s:8:\"username\";s:12:\"Graveyard219\";}i:2;a:2:{s:7:\"user_id\";i:70182;s:8:\"username\";s:9:\"wmbrown18\";}i:3;a:2:{s:7:\"user_id\";i:5473;s:8:\"username\";s:9:\"Oblivious\";}i:4;a:2:{s:7:\"user_id\";i:118053;s:8:\"username\";s:7:\"Frenchy\";}}",
                        "warning_id": 0,
                        "warning_message": "",
                        "anonymous_posting_real_user_id": 0,
                        "anonymous_posting_real_username": ""
                    }
                }
            }
        }
    }
}

Saya benar-benar hanya tertarik pada 

"title":"The ShadyCraft Beta Launch!",  
"reply_count:"45, 
"view_count": 946,  
"user_id":2, 
"username":"Shady", 
"post_date":1366956695, 
"sticky":0, 
"discussion_state":"visible",
"discussion_open":1,

dan akhirnya pesannya 

[ATTACH=full]4143[/ATTACH]

We've completely restructured ShadyCraft, and today will be the launch of the ShadyCraft beta.

Current Features
[LIST]
[*]Towns
[*]Nations
[*]All out wars
[*]A live update map
[*]No White-list
[*]Earn Money
[*]Griefing allowed where possible
[/LIST]
These are just some features which have a lot more things behind them. For instance, there is town and nation upkeep, tax, kingdoms, mayors, and kings.

We really wanted to have the server self-governed and this is why griefing and PvP are allowed where ever they are possible. All towns and nations cannot be griefed by other members. You can create a town and buy plots for it and expand the town as you wish.

[SIZE=4]All of this is shown in the live updating map located [URL='http://50.7.6.116:8123']here[/URL].[/SIZE]

[SIZE=4][SIZE=6]Join the Beta Now[/SIZE][/SIZE]
[SIZE=6]Server-IP: 50.7.6.116[/SIZE]


[USER=118053]Frenchy[/USER] and [USER=4863]Wolfbane[/USER]

Jadi bagaimana saya bisa mengekstrak objek jSON dan memasukkannya ke dalam mengoreksi variabel dalam PHP, yang nantinya bisa saya gunakan? 

Variabel-variabel seperti: $username, $user_id, $message, $title, $discussionState, dan sebagainya.

Saya hanya perlu tahu bagaimana saya bisa mengambil objek jSON, lalu mengekstrak data ke dalam variabel dalam PHP.  

Saya sekarang bisa mendapatkan array PHP, tetapi saya mengalami beberapa masalah dengan memanggil nilai yang benar. Di sini adalah array.

Array ([count] => 1 [utas] => Array ([13] => Array ([thread_id] => 13 [node_id] => 4 [judul] => Integrasi Forum hampir selesai! [Reply_count] => 0 [view_count] => 0 [user_id] => 59 [nama pengguna] => Faeron [post_date] => 1369257302 [lengket] => 0 [diskusi_state] => Terlihat [diskusi_open] => 1 [diskusi_type] => [first_post_id] => 23 [first_post_likes] => 0 [last_post_date] => 1369257302 [Last_post_id] => 23 [last_post_user_id] => 59 [last_post_username] =>.. Faeron [prefix_id] => 1 [konten] => Array ([count] => 1 [content] => Array ([23] => Array ([post_id] => 23 [thread_id] => 13 [ user_id] => 59 [nama pengguna] => Faeron [post_date] => 1369257302 [message] => Ini sudah cukup lama sejak kami mulai mengintegrasikan Forum phanime dengan situs utama. Kami kini telah menyelesaikan integrasi dengan phanime Forum dan situs utama. Anda tidak akan lagi melihat bahwa ada dua .__ platform yang menjalankan phanime, tetapi hanya pada e. Langkah selanjutnya adalah tema forum agar terlihat seperti situs utama! [ip_id] => 268 [message_state] => terlihat [attach_count] => 0 [posisi] => 0 [suka] => 0 [like_users] => a: 0: {} [warning_id] => 0 [warning_message] =>)))))))))

Sekarang katakanlah array ini bernama $array lalu untuk mendapatkan nilai elemen pertama "[count]" tidak bisakah saya mengatakan yang berikut: print $array["[count]"] <- ini mengembalikan kesalahan. 

Bagaimana dengan elemen yang memiliki nilai sebagai array itu sendiri, yang merupakan elemen [threads]. Bagaimana saya mendapatkan, mungkin nilai elemen [thread_id]

Apa itu PHP cURL?

Client URL atau umumnya disingkat menjadi cURL, adalah project open source yang berupa program yang berjalan pada command line (CMD), namun saat ini sudah tersedia library pada banyak bahasa pemrograman seperti PHP, Phyton, dan masih banyak lainya.

Apa itu Metode cURL?

Curl adalah sebuah program dan library untuk mengirim dan mengambil data melalui URL.