Including subdirectories

I’m trying to change the css class of certain directories. Here is the code I’m using:

$theuri = $_SERVER['REQUEST_URI'];
$class = '';
if ($theuri =='/games/') {
  $class = 'menu1';

It works fine when I go to mysitecom/games/ but if I go to mysitecom/games/game it doesn’t work.
My question is how can I make that code include all subdirectories of my games directory.

Thanks in advance,


if (substr($theuri, 0, 7) =='/games/') :slight_smile:


Thanks for the answer and for the link. I knew there had to be a simple answer, I just didn’t know what it was.

Thanks again.