fork download
  1. <?php
  2.  
  3. $res = '1';
  4. if (preg_match('~\^admin#products#(?:p-([0-9]+))?~', '/^admin#products#p-3$/', $matches)) {
  5. if (!empty($matches[1])) {
  6. $res = $matches[1];
  7. }
  8. }
  9. echo "$res\n";
  10. $res = '1';
  11. if (preg_match('~\^admin#products#(?:p-([0-9]+))?~', '/^admin#products#$/', $matches)) {
  12. if (!empty($matches[1])) {
  13. $res = $matches[1];
  14. }
  15. }
  16. echo $res;
Success #stdin #stdout 0.02s 23752KB
stdin
Standard input is empty
stdout
3
1