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 #171274 is a reply to message #171262] Wed, 29 December 2010 23:29 Go to previous messageGo to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On 29/12/10 22:00, richard wrote:
> On Wed, 29 Dec 2010 13:05:25 -0800 (PST), Captain Paralytic wrote:
>
>> On Dec 29, 8:53 pm, richard <mem...@newsguy.com> wrote:
>>> On Wed, 29 Dec 2010 20:37:05 +0000, Denis McMahon wrote:
>>>> On 29/12/10 19:37, richard wrote:
>>>> > Ok smart people, answer me this as I have not yet found an answer googling.
>>>
>>>> > if (a=1) echo "hello";
>>>
>>>> You haven't been listening.
>>>
>>>> You have been told what is wrong with this at least twice in the last
>>>> two days. You are failing to absorb this essential and fundamental piece
>>>> of php.
>>>
>>>> > In BASIC, I can say, if a=1 AND b=2 then do this.
>>>> > Meaning, both conditions MUST be true to get to "do this".
>>>
>>>> php is not basic. You need to use the correct php syntax and constructs
>>>> to do things in php. When you learn the basic php syntaxes and
>>>> constructs, people may become more helpful.
>>>
>>>> > Is it possible to include AND in the PHP if and if so, how?
>>>
>>>> > Maybe like, if (a=1 and b=2) echo "hello";
>>>
>>>> You say you are familiar with the php.net website, yet you obviously
>>>> managed to miss pages referring to control structures, specifically the
>>>> use of if, and logical and comparison operators, despite the fact that
>>>> they can be found in the clearly labelled control structures and
>>>> operators sections of the clearly labelled language reference section of
>>>> the clearly labelled manual.
>>>
>>>> Therefore, for your next lesson, go to the php.net website, find the
>>>> manual pages that deal with:
>>>
>>>> Manual
>>>> Language Reference
>>>> Operators
>>>> Operator Precedence
>>>
>>>> Manual
>>>> Language Reference
>>>> Operators
>>>> Comparison Operators
>>>
>>>> Manual
>>>> Language Reference
>>>> Operators
>>>> Logical Operators
>>>
>>>> Manual
>>>> Language Reference
>>>> Control Structures
>>>> If
>>>
>>>> Once you have read those pages, you will either know the answer to the
>>>> questions that you have asked here, or, if you do not then know the
>>>> answers, will instead know that you have no aptitude whatsoever for
>>>> programming in php and should find another hobby, probably one that does
>>>> not involve computers.
>>>
>>>> Rgds
>>>
>>>> Denis McMahon
>>>
>>> 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.
>>
>> Not "best" you idiot. In php = is an assignment operator and == is a
>> comparison one. They do completely different things.
>>
>> php.net is not wrong, you are an idiot.
>
> Yet, I haven't seen anything on php.net where this is stated.
> Authors often overlook the minor details.

And yet you would have us believe that you have looked at:

Manual
Language Reference
Operators
Comparison Operators

which lists all the valid comparison operators for php. Meanwhile, over on:

Manual
Language Reference
Operators
Assignment Operators

it clearly defines what is a valid php assignment operator.

And yet you can not find this information? The only possible reasons are:

a) that you're not looking for it;
b) that you're incapable of absorbing it when you read it;
c) that you're so lacking in comprehension of basic programming concepts
such as "operators", "control structures", "data types", "assignment"
and "comparison" that you lack the fundamental knowledge needed to
navigate any programming language reference in a meaningful fashion.

The information that you are seeking is present in a clearly identified
form on the website that you claim to be unable to be able to find it
on. Almost (I can think of one other exception) everyone else in this
newsgroup is capable of locating and correctly interpreting that
information without any help whatsoever, yet you insist that it can not
be found even after receiving clear and unambiguous pointers to specific
parts of the on line documentation.

This tells me a great deal about your abilities and mindset.
Specifically that I'd be wasting my time in trying to give you any
further assistance whatsoever.

Rgds

Denis McMahon
[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: Wed Nov 27 01:08:34 GMT 2024

Total time taken to generate the page: 0.04542 seconds