Код: Выделить всё
46.229.168.0/24 # {do not delete} - Thu Nov 14 01:23:31 2019
43.128.88.156 # lfd: Tue Dec 12 11:11:01 2023
150.158.44.71 # lfd: t 3600 secs - Tue Dec 12 11:18:27 2023
Код: Выделить всё
$ips = file('log.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
print_r($ips);
$file = fopen('log.txt',"r");
$ips = [];
while ($line = fgets($file)) {
$ips[] = $line;
}
fclose($file);
print_r($ips);
Код: Выделить всё
Array
(
[0] => 46.229.168.0/24 # {do not delete} - Thu Nov 14 01:23:31 2019
43.128.88.156 # lfd: (sshd) Failed SSH login from 43.128.88.156 (SG/Singapore/-): 5 in the last 3600 secs - Tue Dec 12 11:11:01 2023
150.158.44.71 # lfd: (sshd) Failed SSH login from 150.158.44.71 (CN/China/-): 5 in the last 3600 secs - Tue Dec 12 11:18:27 2023
)
Подробнее здесь: https://stackoverflow.com/questions/786 ... ay-element
Мобильная версия