我有一个数组,数组键包含文件名,数组值将是另一个包含 sfile 大小、日期等的数组。
在这些数组列表中,我只想单独存储xls和xlsx文件。我需要删除所有其他扩展名的文件。
PHP中有任何预定义的函数吗?
注意:我有常量变量,这个变量包含类似 VAR_FILE_EXT= "xls, xlsx, csv"
[sample.xls] => Array (
[size] => 3353
[uid] => 1012
[gid] => 1013
[permissions] => 33188
[atime] => 1338497357
[mtime] => 1338497357
[type] => 1
)
[sample.csv] => Array (
[size] => 3353
[uid] => 1012
[gid] => 1013
[permissions] => 33188
[atime] => 1338497357
[mtime] => 1338497357
[type] => 1
)
[sample.txt] => Array (
[size] => 3353
[uid] => 1012
[gid] => 1013
[permissions] => 33188
[atime] => 1338497357
[mtime] => 1338497357
[type] => 1
)
在此示例中,我只想删除 sample.txt 数组键及其相应的值。