-1

现在,此代码块显示 VLAN。我试图只显示名称(TLSoIP_JB1、TLSoIP_JB2、TLSoIP_JB3)

Array ( 

         [0] => Array ( [0] => TLSoIP_JB1 [1] => 1 ) 
         [1] => Array ( [0] => TLSoIP_JB2 [1] => 2 ) 
         [2] => Array ( [0] => TLSoIP_JB3 [1] => 3 ) 
     )

问候菲利普

4

1 回答 1

1

你可以试试:

foreach ($array as $key => $inner_array) {
    echo $inner_array[0];
}

或者您可以将所需的值存储在单独的数组中,然后打印:

$new_array = array();
foreach ($array as $key => $inner_array) {
    $new_array[] = $inner_array[0];
}
print_r($new_array);
于 2013-10-03T08:41:43.110 回答