Is het mogelijk om direct meerdere pagina's te controleren met behulp van $_SERVER['PHP_SELF'] in een if statement?

Om dit te bereiken gebruik ik nu dit
if($_SERVER['PHP_SELF'] == '/index.php'){ echo 'actief'; } elseif($_SERVER['PHP_SELF'] == '/nieuws.php'){ echo 'actief'; }


Maar ik vroeg me dus af of het ook bijvoorbeeld zo kan
if($_SERVER['PHP_SELF'] == '/index.php' or '/nieuws.php'){ echo 'actief'; }

<?php
    $paginas = array('/index.php', '/nieuws.php');
    if(in_array($_SERVER['PHP_SELF'], $paginas)) {
        echo 'Actief';
    }
?>

Reageren