fork download
  1. <?php
  2.  
  3. $s = array('/chat_3.txt', '/chat_old.txt', '/chat_15.txt');
  4. $matches = array();
  5. $t = preg_filter('/.*_(\d+)\..*/s', '$1',$s);
  6. print_r($t);
Success #stdin #stdout 0.03s 52480KB
stdin
Standard input is empty
stdout
Array
(
    [0] => 3
    [2] => 15
)