FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » AND in the if statement
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: AND in the if statement [message #171254 is a reply to message #171244] Wed, 29 December 2010 21:14 Go to previous messageGo to previous message
Leonardo Azpurua is currently offline  Leonardo Azpurua
Messages: 46
Registered: December 2010
Karma:
Member
"richard" <member(at)newsguy(dot)com> escribió en el mensaje
news:1vbfb0a9uj34w$(dot)dlg(at)evanplatt(dot)sux...
> If my syntax is wrong then so is the coding at php.net.
> From php.net's example:
> <?php
> if ($a > $b)
> echo "a is bigger than b";
> ?>
>
> Where I may use a single = operator in a post, it is only to show what I'm
> after in the whole.
> I understand that it is best to use double == operators in real life.

It is not "best". If you want to test for equality, you *must* use either ==
(equality of values) or === (equality of values and of types): (5 == "5") ==
true; (5 === "5") == false; (5 === 5) == true; ("5" = 5) will produce a
syntax error, since you can't assign to a literal value.

The example that you bring from php.net is Ok. Greater than is spelled >.But
equal is spelled == or ===. On the other hand, >> is the right shift
operator.

If you really want to learn, you should be humble enough to know where you
are mistaken, instead of trying to hold your position regardless of how
wrong you are.

Denis' post is the best advice that you can get at this point. Go RTFM.

--
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: php-debug-faq-post in progress
Next Topic: using same variable twice on same page
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 12:32:50 GMT 2024

Total time taken to generate the page: 0.03981 seconds