fork download
  1. <?php
  2.  
  3. $url = "/subdir/file.php/this/is/a/path/info?par=am1&param=2";
  4. $pth = parse_url($url, PHP_URL_PATH);
  5. $chunks = preg_split('~(?<=\.php)(?=/)~', $pth);
  6. foreach ($chunks as $chunk) {
  7. echo $chunk . "\n";
  8. }
  9. echo parse_url($url, PHP_URL_QUERY) . "\n";
Success #stdin #stdout 0s 52488KB
stdin
Standard input is empty
stdout
/subdir/file.php
/this/is/a/path/info
par=am1&param=2