- print_r: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$re = '/1000(\d+)1500/mi';
$str = '10001212121212121500
100012121500
10001500';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
$expected = [];
foreach($matches as $match){
$expected[] = $match[1];
}
print_r($expected);
?>