You are here: Re: Whats the diffecence between '&' and '&&' operators? « PHP Language « IT news, forums, messages
Re: Whats the diffecence between '&' and '&&' operators?

Posted by Jam Pa on 05/25/05 19:19

"Kimmo Laine" <eternal.erectionN0.5P@Mgmail.com> wrote in
news:d727g3$9e$1@phys-news1.kolumbus.fi:
>
> & and | are bitwise arithmetic operators while && and || are boolean
> operators. What this maeans is that & and | handle single bits in and
> integer, but && and || evaluate the entire integer as true or false.
[a LOT deleted]

Thank juu Kimmo! Jotain tollaista mun kokeilutkin indikoi! :) Salatiedettδ!

So, what should one use when comparing in if clauses or ternary ? : ops
when evaluating the validity of user input, for instance?

Is this better?
if ($gee && $whiz) { //do shiz)

or perhaps
if ($gee AND $whiz) { //do... }

Jp

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация