Welcome Guest, Not a member yet? Register   Sign In
Getting data in a big array codeigniter
#5

(This post was last modified: 10-01-2019, 05:30 PM by tp45.)

(10-01-2019, 09:48 AM)Wouter60 Wrote: By default, arrays start with index 0. So 0 is the key of the first element in an array, 1 for the next element and so on.

In your code:
PHP Code:
$data['suggest'] = array(
'suggestedUser' => $data['suggested'][0]->suggestedUser,
'mutualFriend'  => $data['suggested'][0]->mutualFriends,
); 
you only put the first element [0] in the 'suggestedUser' and 'mutualFriend' elements. That's why you only get one user.
Ok i see but how to get 0 and 1, i tried to remove the 0s but i get an error 
anyway thanks for replying .

i will keep trying to figure it out.

(10-01-2019, 06:05 AM)mboufos Wrote: hello, i am working on arrays couple months now  and if i want to manage/change/delete/etc the easiest way it to encode it to json_encode("The array here"), and then its easy Tongue
Thanks @mboufos for replying.
let me try this way too
Reply


Messages In This Thread
Getting data in a big array codeigniter - by tp45 - 09-27-2019, 01:05 PM
RE: Getting data in a big array codeigniter - by tp45 - 10-01-2019, 05:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB