0
這是我的輸出陣列:如何從數組中刪除空鍵值?
Array
(
[0] =>
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
[6] =>
[7] => 200
[8] => 200
)
但我只需要: [7] => 200
[8] => 200
任何想法?
這是我的輸出陣列:如何從數組中刪除空鍵值?
Array
(
[0] =>
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
[6] =>
[7] => 200
[8] => 200
)
但我只需要: [7] => 200
[8] => 200
任何想法?
例如,
$a= array
(
0 => '',
1 => '',
2 => '',
3 => '',
4 => '',
5 => '',
6 => '',
7 => 200,
8 => 200,
);
print_r(array_filter($a));
你可以做到這一點是:
print_r(array_filter($Array));
'array_filter($ your_array)' – roullie
'的print_r(array_filter($ your_array) );' –
你可以請你的代碼有問題嗎? –