将PHP字符串放在do_shortcode打开和关闭中

I'm working with a membership based site where I need to restrict contact information. I need to insert this content inside opening and closing shortcode :

[level-accountant][/level-accountant]

The content I need to restrict is this :

<?php $order = array('billing_company', 'billing_address_1', 'billing_address_2', 'billing_city', 'billing_postcode', 'billing_state', 'country');
    $result = array();
    foreach($order as $elem){
    if($user_meta[$elem][0] != "")
    $result[] = $user_meta[$elem][0];
    }
    echo implode(', ', $result);
    ?>

I have followed this answer here : How to put php code inside opening and closing shortcodes

and tried this code :

<?php echo do_shortcode('[level-accountant]'.$order = array('billing_company', 'billing_address_1', 'billing_address_2', 'billing_city', 'billing_postcode', 'billing_state', 'country');
    $result = array();
    foreach($order as $elem){
    if($user_meta[$elem][0] != "")
    $result[] = $user_meta[$elem][0];
    }
    echo implode(', ', $result);.'[/level-accountant]'); ?>

But just can't figure out how to place my content inside. This code is giving me errors.

This should be as easy as

$order = array('billing_company', 'billing_address_1', 'billing_address_2', 'billing_city', 'billing_postcode', 'billing_state', 'country');
$result = array();
foreach($order as $elem){
    if($user_meta[$elem][0] != "") {
        $result[] = $user_meta[$elem][0];
    }
}
echo do_shortcode('[level-accountant]'.implode(', ', $result).'[/level-accountant]');

In the above code, I just took the part of code which you wrongly put in the do_shortcode() call and placed it before, saving the result in a variable.