I am trying to hide a link on my navigation bar on certain pages of my website. I have a system which works for one page, but when I try to add more than one string to the if statement, it does not work. Can anyone offer advice on how to fix this?
Working statement which hides the link on one page:
<?php
$url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
if (strpos($url, 'terms-of-use') !== false) {
}
else {
echo '<li class="nav-item"><a class="nav-link" href="'. basename($_SERVER['PHP_SELF']) .'" title="Contact Us">Contact Us</a></li>';
}
?>
I have tried adding the following:
if (strpos($url, 'terms-of-use', 'case-studies', 'cookie-policy', 'privacy-policy') !== false) {
if (strpos(…) === false) { echo … }!