Long story short, I need to access the some raw object data returned by flexifield. It looks like this:

    [node_data_field_price_matrix_field_price_matrix_item_id] => Array
        (
            [0] => Array
                (
                    [type] => price_matrix
                    [value] => a:2:{s:27:"field_price_matrix_quantity";a:1:{i:0;a:2:{s:5:"value";s:1:"6";s:14:"_error_element";s:67:"field_price_matrix][0][value][field_price_matrix_quantity][0][value";}}s:22:"field_price_matrix_ppu";a:1:{i:0;a:2:{s:5:"value";s:3:"605";s:14:"_error_element";s:62:"field_price_matrix][0][value][field_price_matrix_ppu][0][value";}}}
                    [item_id] => 405
                )

            [1] => Array
                (
                    [type] => price_matrix
                    [value] => a:2:{s:27:"field_price_matrix_quantity";a:1:{i:0;a:2:{s:5:"value";s:2:"12";s:14:"_error_element";s:67:"field_price_matrix][1][value][field_price_matrix_quantity][0][value";}}s:22:"field_price_matrix_ppu";a:1:{i:0;a:2:{s:5:"value";s:3:"580";s:14:"_error_element";s:62:"field_price_matrix][1][value][field_price_matrix_ppu][0][value";}}}
                    [item_id] => 406
                )

            [2] => Array
                (
                    [type] => price_matrix
                    [value] => a:2:{s:27:"field_price_matrix_quantity";a:1:{i:0;a:2:{s:5:"value";s:2:"24";s:14:"_error_element";s:67:"field_price_matrix][2][value][field_price_matrix_quantity][0][value";}}s:22:"field_price_matrix_ppu";a:1:{i:0;a:2:{s:5:"value";s:3:"540";s:14:"_error_element";s:62:"field_price_matrix][2][value][field_price_matrix_ppu][0][value";}}}
                    [item_id] => 407
                )

        )

How do I deserialize the value element?

Comments

mpaler’s picture

sorry for those long lines...

mpaler’s picture

Status: Active » Closed (fixed)

uugh. sorry for the hasty post. It can be done as follows:

print_r( unserialize($data->node_data_field_price_matrix_field_price_matrix_item_id[0]['value'] ) );

see php unserialize.