Don't use the $currentUrl
when checking $hostArray
, just check to see if the $host
itself is in the $hostArray
.
If you want to check for an exact match:
if(in_array($host, $hostArray)) {
$useMin = false;
}
Or maybe you want to do this, and check to see if an item in $hostArray
exists anywhere within your $host
:
foreach($hostArray AS $checkHost) {
if(strstr($host, $checkHost)) {
$useMin = false;
}
}
And if you only want to find a match if $host
starts with an item in $hostArray
:
foreach($hostArray AS $checkHost) {
if(strpos($host, $checkHost) === 0) {
$useMin = false;
}
}