for this array,
(对于这个数组,)
Array (
[0] => 'HOST:'
[1] => 'killbill'
[2] =>
[3] =>
[4] =>
[5] =>
[6] =>
[7] =>
[8] =>
[9] =>
[10] =>
[11] => 'Loss%'
[12] =>
[13] =>
[14] => 'Snt'
[15] =>
[16] =>
[17] => 'Last'
[18] =>
[19] =>
[20] =>'id'
)
it has empty values.by using this code it gives
(它具有空值。通过使用此代码,它给出了)
foreach($array as $key => $subarray) {
$array[$key] = preg_grep('/^$/', $subarray, PREG_GREP_INVERT);
}
array (
[0] => HOST:
[1] => killbill
[11] => Loss%
[14] => Snt
[17] => Last
[20] =>id
)
that means it removes all the spaces.
(这意味着它将删除所有空格。)
but it has the original key values .(compair above one and bellow one. then can get a clear idea what i'm saying).but i want to have it like this. (但它具有原始键值。(将其替换为大于1的值,然后按下面的波纹即可。然后我可以清楚地知道我在说什么)。但是我想要这样。)
array (
[0] => 'HOST:'
[1] => 'killbill'
[2] => 'Loss%'
[3] => 'Snt'
[4] => 'Last'
[5] => 'id'
)
key values as 1,2,3,4.... so how could i get that.
(键值为1,2,3,4 ....所以我怎么能得到它。)
ask by Thusitha Sumanadasa translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…