- var_dump: documentation ( source)
- explode: documentation ( source)
<?php
$str = "2017-07-10 16:04:18 (4261) INFO : Running distributed import (mode 1) on all PMs... 2017-07-10 16:04:19 (4261) INFO : For table test.sales: 9 rows processed and 9 rows inserted. 2017-07-10 16:04:19 (4261) INFO : Bulk load completed, total run time : 1.03363 seconds";
$log = explode($str, "2017");
echo $str;
var_dump($log);