Skip to content

Instantly share code, notes, and snippets.

@davidDuymelinck
Created March 27, 2015 05:45
Show Gist options
  • Save davidDuymelinck/451f4c072989ea02cf2c to your computer and use it in GitHub Desktop.
Save davidDuymelinck/451f4c072989ea02cf2c to your computer and use it in GitHub Desktop.
quick and dirty php routing
<?php
$path = isset($_SERVER['REDIRECT_URL']) ? $_SERVER['REDIRECT_URL'] : $_SERVER['REQUEST_URI'];
if(strpos($path, '/search/book') !== false){ echo str_replace('/search/book/', '', $path); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment