如果我使用array_filter过滤数组以消除空值,则会保留密钥并在数组中生成"漏洞".例如:
The filtered version of
[0] => 'foo'
[1] => null
[2] => 'bar'
is
[0] => 'foo'
[2] => 'bar'
Run Code Online (Sandbox Code Playgroud)
相反,我怎么能得到
[0] => 'foo'
[1] => 'bar'
Run Code Online (Sandbox Code Playgroud)
?