# Proper Syntax/ How to Question?

**URL:** <https://www.phphelp.com/t/proper-syntax-how-to-question/9531>\
**Category:** Beginners - Learning PHP\
**Created:** [December 5, 2006, 12:59am UTC](https://www.phphelp.com/t/proper-syntax-how-to-question/9531 "2006-12-05T00:59:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eradio](https://www.phphelp.com/letter_avatar_proxy/v4/letter/e/b5a626/32.png) [@eradio](https://www.phphelp.com/u/eradio)\
**Post date:** [December 5, 2006, 12:59am UTC](https://www.phphelp.com/t/proper-syntax-how-to-question/9531/1 "2006-12-05T00:59:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Monk](https://www.phphelp.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@Monk](https://www.phphelp.com/u/Monk)\
**Post date:** [December 5, 2006, 2:08am UTC](https://www.phphelp.com/t/proper-syntax-how-to-question/9531/2 "2006-12-05T02:08:52Z")

</div>

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…

```auto
<?php

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

...

}

?>
```

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

---

<div class="post-metadata">

**Author:** ![eradio](https://www.phphelp.com/letter_avatar_proxy/v4/letter/e/b5a626/32.png) [@eradio](https://www.phphelp.com/u/eradio)\
**Post date:** [December 5, 2006, 2:58am UTC](https://www.phphelp.com/t/proper-syntax-how-to-question/9531/3 "2006-12-05T02:58:59Z")

</div>

That worked…thank you for the assistance. ![:D]()

---

<div class="post-metadata">

**Author:** ![peg110](https://www.phphelp.com/letter_avatar_proxy/v4/letter/p/bb73d2/32.png) [@peg110](https://www.phphelp.com/u/peg110)\
**Post date:** [December 5, 2006, 3:01am UTC](https://www.phphelp.com/t/proper-syntax-how-to-question/9531/4 "2006-12-05T03:01:07Z")

</div>

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.
