fork download
  1. <?php
  2.  
  3. $s = "€ 5000\n€ 3000\n€ 10000\n€ 13000\n€ 20000\n\n€ 5000\n€ 3000\n€ 100000\n\n€ 13000\n€ 200000\n\n€ 200000000000\n\n\n€ 255000\n€ 2555000\n€ 255000";
  4. if (preg_match_all('~€\s*\K\d+~u',$s, $matches)) {
  5. print_r(array_filter($matches[0], function ($m) { return $m % 5000 === 0; }));
  6. }
  7.  
Success #stdin #stdout 0s 82944KB
stdin
Standard input is empty
stdout
Array
(
    [0] => 5000
    [2] => 10000
    [4] => 20000
    [5] => 5000
    [7] => 100000
    [9] => 200000
    [10] => 200000000000
    [11] => 255000
    [12] => 2555000
    [13] => 255000
)