Jump to content


Photo

can u use if($a == 5 AND $b == 5)


  • Please log in to reply
8 replies to this topic

#1 brown2005

brown2005
  • Members
  • PipPipPip
  • Advanced Member
  • 943 posts

Posted 06 September 2006 - 09:07 AM

hi i was wondering if u could use to if satements together and how u do it?

if($a == 5 AND $b == 5)

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 06 September 2006 - 09:11 AM

if (($a==5) && ($b==5)) { ...

Legend has it that reading the manual never killed anyone.
My site

#3 brown2005

brown2005
  • Members
  • PipPipPip
  • Advanced Member
  • 943 posts

Posted 06 September 2006 - 09:15 AM

thanks very much

#4 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 06 September 2006 - 12:14 PM

Note that you can also use 'AND' instead of '&&', but they have different priorities.

#5 brown2005

brown2005
  • Members
  • PipPipPip
  • Advanced Member
  • 943 posts

Posted 06 September 2006 - 12:15 PM

wat are the different priorities

#6 quillspirit

quillspirit
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts
  • LocationOregon, USA

Posted 06 September 2006 - 01:49 PM

Same question... what do you mean by different priorities? I have always used AND.
Peace,
Shawn
Simple PHP

#7 Kano

Kano
  • Members
  • PipPipPip
  • Advanced Member
  • 76 posts
  • LocationEngland

Posted 06 September 2006 - 01:53 PM

I think SemiApocalyptic means different priorities like in maths times is calculated before add and brackets is done first etc...

#8 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 06 September 2006 - 01:58 PM

http://ca3.php.net/m...tors.precedence
Legend has it that reading the manual never killed anyone.
My site

#9 brown2005

brown2005
  • Members
  • PipPipPip
  • Advanced Member
  • 943 posts

Posted 06 September 2006 - 02:01 PM

ok ill have a look. thanks




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users