0

I have this array in PHP.

Array
(
    [0] => Array
        (
            [0] => Array
                (
                    [type] => and
                    [rows] => Array
                        (
                            [0] => Array
                                (
                                    [field] => custom_field_key_become_custom_field_key
                                    [operator] => ends with
                                    [operand] => description
                                    [is_operand_dynamic_field] => 1
                                )

                        )

                )

        )

    [1] => Array
        (
            [0] => Array
                (
                    [field] => my custom field
                    [operator] => set to value
                    [operand] => 
                    [is_operand_dynamic_field] => 
                )

        )

    [2] => Array
        (
            [0] => Array
                (
                    [type] => and
                    [rows] => Array
                        (
                            [0] => Array
                                (
                                    [field] => custom_field_key_become_custom_field_key
                                    [operator] => ends with
                                    [operand] => description
                                    [is_operand_dynamic_field] => 1
                                )

                        )

                )

        )

    [3] => Array
        (
            [0] => Array
                (
                    [field] => My custom field 2
                    [operator] => set to value
                    [operand] => 
                    [is_operand_dynamic_field] => 
                )

        )

)

Now, I need to get the key field value if the key is_operand_dynamic_field value is equal to 1.

Please note that the key field and is_operand_dynamic_field can be in more nested array.

So, is there any better way to get it easily?

I have tried with foreach loop but its seems that I need to use more loop.

Any help would be much appreciated.

Shibbir
  • 1,963
  • 2
  • 25
  • 48

0 Answers0