how can i get [user_id] from this array?
Array
(
[2] => cbpaidSubscription Object
(
[replaces_plan] =>
[replac
If you can guarantee that the array only has one item and you know the key, then go with Jonathan Sampson's solution. Otherwise if you have a few items you can loop over it like this and extract the userid for each one.
foreach ($array as $item) {
$userId = $item->user_id;
//do something with the userId for this item
}
I'm thinking...
print $arrayName[2]->user_id;