Skip to content

Instantly share code, notes, and snippets.

@lpirola
Created March 7, 2011 21:10
Show Gist options
  • Save lpirola/859233 to your computer and use it in GitHub Desktop.
Save lpirola/859233 to your computer and use it in GitHub Desktop.
<?php
$pages = array('pele-net.php', 'retro-2010.php', 'ir-2011.php');
$current_page = $_SEVER['SCRIPT_NAME'];
$current_idx = array_search($current_page,$pages);
$next_page = $current_page[$current_idx+1];
$previous_page = $current_page[$current_idx-1];
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment