How to store post meta in an array

WordPress automatically serializes/unserializes the data when it’s stored and retrieved, all you need to do is pass a php array as your data and you’ll get the same array back when you get_post_meta.

$data = array(
    'label' => 'something',
    'desc' => 'someval',
    'id' => 'someval',
    'type' => 'someval'
);
update_post_meta( $post_id, 'your_key', $data );


$data = array(
    'field_1' => array(
        'label' => 'something',
        'desc' => 'someval',
        'id' => 'someval',
        'type' => 'someval'
    ),
    'field_2' => array(
        'label' => 'something',
        'desc' => 'someval',
        'id' => 'someval',
        'type' => 'someval'
    )
);
update_post_meta( $post_id, 'your_key', $data );