fork(3) download
  1. <?php
  2.  
  3. $text = 'something/aaa/9321/something';
  4. $first = preg_quote('aaa/', '/');
  5. $after = preg_quote('/', '/');
  6. preg_match("/$first(.*)$after/s",$text,$result);
  7. echo $result[1];
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
9321