- array_map: documentation ( source)
- preg_match_all: documentation ( source)
<?php
// $simpulated = file_get_contents("data/data.txt");
$simulated = '
gjhgfgshaffhdfhsds
gsdfdgfebrewujbflken
fkdnwjefwibiuwbfbef
000:000:000:000;
06/06/19-11:11:11;11.111;
08/08/19-13:40:01;22.875;
10/11/19-10:00:00;20.000;
';
preg_match_all("/\d{2}\/\d{2}\/\d{2}-\d{2}:\d{2}:\d{2};\d{2}\.\d{3};/", $simulated, $matches);
if(count($matches["0"]) > 0) {
array_map(function($match) { echo $match . "\n"; }, $matches["0"]);
}