UPDATE
Sorry for the dead brain response. missed the first line. as stated above, you can create an array of pages and user in_array ()
$pagelist = array('page1.php','page2.php','page3.php','page4.php','page5.php') if (in_array($page,$pagelist)) {
it's a bit more elegant and definitely clears the if statement, but doesn't do much to reduce the code. the only advantage I can imagine is that you could build an $ pagelist array from an external source, and use it could be more efficient?
source share