explode('/', $_SERVER['REQUEST_URI'])[4])); $number = 1; foreach ($comments as $c) { $comm = new Comment($c); if ($number % 2 == 0) { $class = 's11'; } else { $class = 's1'; } $comm->class($class); $number++; $comm->i(); } } }