Created
October 31, 2011 16:12
-
-
Save jbrooksuk/1327855 to your computer and use it in GitHub Desktop.
PHP Switch in_array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$curURL = trim($_SERVER['REQUEST_URI'], '/'); | |
$arURLParts = explode('/', $_SERVER['REQUEST_URI']); | |
foreach($arURLParts as $urlPart) { | |
${$urlPart} = $urlPart; | |
switch ($urlPart) { | |
case 'hotels': | |
$hotelPage = (($_GET['brand'] == "excellence") ? false : true); | |
break; | |
case 'country': | |
$countryPage = true; | |
break; | |
case (in_array($res_iso_lookup[$urlPart][0], $res_iso_uri['cw']) ? $urlPart : ''): | |
$currentCountry = $urlPart; | |
break; | |
default: | |
$otherPage = $urlPart; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment