Pls how do I retrieve the title from this json usng PHP
{
"kind": "plus#activityFeed",
"etag": "\"U2cYozG4eBioYd-8MEmyk8vsux4/98RQufcXcSAhnognM4kqOBjWygU\"",
"items": [
{
"kind": "plus#activity",
"etag": "\"U2cYozG4eBioYd-8MEmyk8vsux4/AMRVwIlEV6SoJ8ZkMErQKx04FIc\"",
"title": "Reshared post from Jesse Oguntimehin\n \n\nMy post for #GNigeria day 2
The JSON is incomplete so my answer can only be to the snippet that you posted.
The syntax to reach the title field should be –
Note that I put
items[0]because items is an array – notated with the square brakets[ ]. But the first element of that array seems to be an object – so we can continue with dot notation to reach thetitleproperty.Convert it into a PHP array using
json_decode($str,true)and take a look at the contents – that should be easier to get at.