Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: 4d assoc array access

17 views
Skip to first unread message

Denis McMahon

unread,
Feb 25, 2015, 10:34:31 AM2/25/15
to
For some reason, every time I try and reply to the original post the
message disappears.

On Mon, 23 Feb 2015 00:09:40 -0800 (PST) Adnan Shiekh
<adnans...@gmail.com> wrote:

> I have a question how to access 4 dimesional array efficiently in php

1) Your JSON is broken.

2) If you want json_decode to create an associative array in php you need
to set the right options in the call to json_decode. Read the php manual
for the json_decode function.

3) To access 'hello2' in the associative array generated from the
corrected json data, use:

$result['output']['data'][1]['password']

--
Denis McMahon, denismf...@gmail.com

Albertestein

unread,
Feb 25, 2015, 10:44:53 PM2/25/15
to
1. No, i think json is not broken, basically it's received by website auto decode and store in to $result like that $result = $Classobj->getResponse($page);

2. i no need to convert the json..because it's auto return and store in associative array.


3. that's not correct.. i m send correct associative array in another post check this...

Correct is shown below but almost same..
$result['response']['result'][$i]['id'];

i want to access every id present in complete array

but how to write loop to access all id elements in array...

thanks for your replying i hope you can understand..
0 new messages