Example:
$string = \"This is some text written on 2010-07-18.\";
preg_match(\'|(?\\d\\d\\d\\d-\\d\\d-\\d\\d)|i\', $string, $arr_result);
print_r(
I use some of introduced codes and this is the final code works on php 5.6+:
$re = '/\d+\r\n(?[\d\0:]+),\d+\s--\>\s(?[\d\0:]+),.*\r\nHOME.*\r\nGPS\((?[\d\.]+),(?[\d\.]+),(?[\d\.]+)\)\sBAROMETER\:(?[\d\.]+)/';
$str= file_get_contents($srtFile);
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
echo '';
$filtered=array_map(function ($d){
return $array_filtered = array_filter($d, "is_string", ARRAY_FILTER_USE_KEY);
},$matches);
var_dump($filtered);
if you are interested what it does it read position data from a str file that DJI drones generate while recording video.