我如何运行多个参数array_filter
?这是我的带有多个参数和array_filter
代码的函数
function is_txt($file, $user) {
return preg_match('/backup-[0-9]+\.[0-9]+\.[0-9]+_[0-9]{2}-[0-9]{2}-[0-9]{2}_'.$user.'.tar.gz/', $file) > 0;
}
....
$list = ftp_nlist($conn_id, $ftp_dir);
$filtered = array_filter($list, 'is_txt');
if(count($filtered)){
foreach( $filtered as $name => $file){
echo $file;
echo "<br>";
}