所以我有一个有很多选项的大数组,全部用于汽车,所以里程和声音等等现在可以说我的客户不提供里程,在我将这个数组发送到我的函数之前,我想确保每个元素都不为空,那些没有被放置在一个新的数组中,将被发送用于 sql 插入
这是我的数组:
Array ( [year] => select [make] => Buick [model] => [engine] => [mileage] => [price] => [vin] => [att1] => [att2] => [att3] => [att4] => [bodystyle] => [fuel] => [hp] => [cyl] => Select [enginesize] => L [transmission] => [shifts] => [od] => [sound] => [gps] => [sound_system] => [sradio] => [tachometer] => [clock] => [trip] => [eweather] => [digitalboard] => [drive] => [fxf] => [cruisecontrol] => [tiltsteering] => [ac] => [removabletop] => [keyless] => [airbags] => [alloy] => [trunkantitrap] => [ewindows] => [emirrors] => [eseat] => [elocks] => [antitheft] => [ledheadlights] => )
那么我如何循环遍历它,如果它不是空的,则将它添加到一个新数组中,同时也是一个关联的集合名称和值
对不起,我有点困惑