Thanks! And, *wow* yes I just did try php2asp. Pretty good translation,
although a few things need adjusting, it seems to do a remarkable job. I'll
definitely have to play with it some more.
:)
-Brian
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/un
Brian Anderson wrote:
What is the proper syndax in an if statement for containing multiple conditions?
example:
if ( condition1 && condition2 ) {
dothis;
}
if ( condition1 && (condition2 || condition3) ) {
dothis;
}
Both are valid. First example will validate if both condition1 and
condi
On Mon, 13 Sep 2004 11:32:00 -0500, Brian Anderson
<[EMAIL PROTECTED]> wrote:
> What is the proper syndax in an if statement for containing multiple conditions?
>
> example:
>
> if ( condition1 && condition2 ) {
>
> dothis;
> }
>
> if ( condition1 && (condition2 || condition3) ) {
>
>
Brian Anderson wrote:
What is the proper syndax in an if statement for containing multiple conditions?
both examples you have given are valid but their logic is slightly
different.
example:
if ( condition1 && condition2 ) {
dothis;
}
if ( condition1 && (condition2 || condition3) ) {
doth
Martin Clifford wrote:
> There are no brackets necessary if you only have one line of code to be executed in
>the case. For example:
>
> if($var == 1)
> echo "Var equals 1";
> } else {
> echo Var does not equal 1";
> }
This will certianly give a parse error, your sample should be:
if
Hmm. I should read a bit further myself! I did not know about the colon
indicating that there can be many statements before "else" or "endif".
I've learnt something as a result, thanks. I should do some more
engaging brain before keyboard!
Chris
Chris Hewitt wrote:
> --snip--
Alexander,
The thing to do is to try it yourself. Yes its OK for single statements
(I assume the colon after the "$condition):" is a typo. The first two
examples in the manual (Chapter 11, if) show this syntax though not with
"else".
HTH
Chris
Alexander Ross wrote:
>
>if($something):
> ...
OK...
This is another easy question that everyone has an answer for.
Here's mine
:D
the if statement has many ways of being formed.
1 line code: (Echo or exit command)
if(empty($Variable))
exit;
else
echo "Variable exists
Multiple line code:
if(empty($Variable))
{
header("Location:
uly 10, 2002 7:28 AM
Subject: Re: [PHP] if syntax
> This will only work if you have a single line of code after the else and
> if. At least that is my understanding of all languages :)
>
> J
>
>
>
>
>
> "Alexander Ross" <[EMAIL PROTECTED]>
>
There are no brackets necessary if you only have one line of code to be executed in
the case. For example:
if($var == 1)
echo "Var equals 1";
} else {
echo Var does not equal 1";
}
But this is not valid:
if($var == 1)
echo "Var equals ";
echo "1";
} else {
}
HTH
Mar
This will only work if you have a single line of code after the else and
if. At least that is my understanding of all languages :)
J
"Alexander Ross" <[EMAIL PROTECTED]>
07/10/2002 08:25 AM
To: [EMAIL PROTECTED]
cc:
Subject:[PHP] if syntax
I know t
11 matches
Mail list logo