Is there an easy way for me to get the values from this array hash? I'm using it all the time and would like to use something without iterating/ checking values?

$node[field_cw_days] = Array
        (
            [0] => Array
                (
                    [value] => mon
                )

        [1] => Array
            (
                [value] => wed
            )

        [2] => Array
            (
                [value] => fri
            )

    )

Something like this?

$days = implode('-', array_values(array_merge_recursive($days_array, (array)'')));

Thanks for any help

    helllo

    I am sure there is a more 'simple' way,
    but this would work:

    $str = ''; // empty string
    foreach( $node['field_cw_days'] as $subarray ){
        $str .= $subarray['value'] . '-'; // add to string
    }
    $str = rtrim($str, '-'); // 'right trim' away the last '-'
    
    // test
    echo $str;

    about such arrays, with plenty of dimensions, when could be less:
    there is something not optimal to use more dimension, than necessary
    so, the setup is not perfect, from beginning

    in your case,
    you would only need 1 array, without subarrays,
    with number indexed elements

    array(
    [0] => 'mon',
    [1] => 'fri',
    [2] => 'sun'
    )
    string = implode( '-', array );

      Write a Reply...