Skip to content

Instantly share code, notes, and snippets.

@steveathon
Created August 18, 2014 12:32
Show Gist options
  • Select an option

  • Save steveathon/c48b1b4eea5d8c5aa093 to your computer and use it in GitHub Desktop.

Select an option

Save steveathon/c48b1b4eea5d8c5aa093 to your computer and use it in GitHub Desktop.

Revisions

  1. steveathon created this gist Aug 18, 2014.
    13 changes: 13 additions & 0 deletions serverExplode.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    <?php

    $URIParts = explode('?',$_SERVER['REQUEST_URI']);
    $URI = explode('/',$URIParts[0]);
    // Shift the array, to move it past the 'root'
    @array_shift($URI);
    // Now, get rid of any pesky empty end slashes
    while ( @count($URI) > 0 && !end($URI) ) {
    @array_pop($URI);
    }

    print_r($URI);
    ?>