Reputation: 385
Getting stuck with the indexing problem in php codeigniter. I am trying to access the value of the key .
array(1)
{
[0]=> object(stdClass)#20 (11)
{
["id"]=> string(1) "1"
["user_id"]=> string(2) "49"
["username"]=> string(0) ""
["first_name"]=> string(0) ""
["last_name"]=> string(0) ""
["u_id"]=> string(1) "6"
}
}
Here i am trying to get the value of the "u_id" by
$u_array->u_id` but getting error.
Upvotes: 0
Views: 45
Reputation: 1934
I think you may have to reference the key of the object stored in the array.
$u_array[0]->u_id
Upvotes: 1