Proper Syntax/ How to Question?

I need to know the proper syntax for allowing more then one section in this include.
This code below allows a “top” include only if this section loads.

<? if($section == "frontpage") { ?>

How would I add another section. I tried commas, quotes and a few other variations.

<? if($section == "frontpage, another section, more sections") { ?>

Whats the magic formula?
Thanks for the help

From what I can tell, in words you want “If the section is A, B, or C then include”

So in PHP that would be…


if( $section == "frontpage" || $section == "another section" || $section == "more sections" ) {




The double bar ("||") is a logical OR statement.

That worked…thank you for the assistance. :D

The Double Pipe || is a logical OR but you can also (depending on your needs) use the Double Ampersand && for a logical AND as well.

Sponsor our Newsletter | Privacy Policy | Terms of Service