My url's are similar like this:
website/search/category,Room/region,Oregon/
website/search/category,Room/
website/search/category,Room/city,Palm Bay/
website/search/city,Palm Bay/
website/search/region,Florida/
It always contains single or combination of CATEGORY CITY REGION
I want to echo in an if statement, for example:
if url contains "category,xxx" then echo "category is xxx".
(xxx can be anything)
I found this code:
<?php $url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
if (false !== strpos($url,'Room')) {
echo 'Room';
}
echo 'No Room';
} ?>
But this method is large when I have 12 or more category words, 50 region names, and hundreds of city words to compare. How to make this more easy?