/** 批量查询文件夹及子目录下的文件是否包含外链
* @return void
*/
public function Filedetection()
{
// 待检测的文件夹路径
$dir = Env::get('root_path') . 'public';
// 要排除的域名列表
$exclude_domains = [
'beian.miit.gov.cn',
'hm.baidu.com',
'www.beian.gov.cn',
'mp.weixin.qq.com',
];
// 要排除的文件类型列表
$exclude_filetypes = ['jpg', 'png', 'gif','pdf','js','php','css','svg','psd'];
// 搜索文件夹及子目录下的文件是否包含外链
$results = $this->search_files($dir, $exclude_domains, $exclude_filetypes);
// 导出Excel文件
$xlsData[] = [
'A1' => '路径',
'B1' => '疑似内容',
];
$i = 2;
foreach ($results as $value) {
$xlsData[] = [
php 批量查询文件夹及子目录下的文件是否包含外链、手机号、身份证号
最新推荐文章于 2024-07-10 21:39:46 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)