I have written the following IF statement
if ($mainCat && $subCat) {
$url = "/subjects/".$mainCat->alias."/".$r->alias;
}
Which is working great. You can see a demo here: http://217.199.187.199/equityschooltravel.co.uk/
However I have expanded on it and want to include an elseif, if a variable is present but it's not working:
if ($subCat == 78) {
$url = "/subjects/".$mainCat->alias."/".$subCat->alias."/".$r->alias;
}
elseif ($mainCat && $subCat) {
$url = "/subjects/".$mainCat->alias."/".$r->alias;
}
The idea is, if a country ($subcat) is selected with an ID of '78' the URL will be rendered differently.
isset();orempty();although I might have misunderstood your questionif ($subCat == 78)since the first piece of code contains the same but set in yourelseif<?php error_reporting(E_ALL); ini_set('display_errors', 1);then the rest of your code, to see if it yields anything.