Skip to content

Instantly share code, notes, and snippets.

@lleitep3
Created May 16, 2011 13:44
Show Gist options
  • Save lleitep3/974456 to your computer and use it in GitHub Desktop.
Save lleitep3/974456 to your computer and use it in GitHub Desktop.
by default, I always keep the page as the first parameter of the uri.
<?php
$uriPath = parse_url ($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$uriPath = explode('/', trim($uriPath, '/') );
$page = reset($uriPath);
require $page . '.php';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment