Get a value from within an array of objects

     

I need to use a value within an array in a custom function I am creating for WooCommerce memberships.


I am using the code:


//Set Arguments   $args = array(   'plan_id' => 148169 //This is the plan number   'user_id' => $user_id   );
// Return the membership number   $user_membership = wc_memberships_get_user_membership( $user_id