I have this Array, $rule
WC_Memberships_Membership_Plan_Rule Object
(
[data:WC_Memberships_Membership_Plan_Rule:private] => Array
(
[membership_plan_id] => 513
[id] => rule_5ac4cbbe44f46
[object_ids] => Array
(
[0] => 385
)
[discount_type] => amount
[discount_amount] => 1.78
[active] => yes
[rule_type] => purchasing_discount
[content_type] => post_type
[content_type_name] => product
[rule_key] => 1
)
)
I need to capture the value of [membership_plan_id]
but I tried everything already.
Another option would be to use array_key_exists('membership_plan_id',$rule)
but it also did not work.