![]() |
|
|||||||
| Chit Chat Public Talk about any thing you want! This forum is public. |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||||||||||
|
|||||||||||
|
Can someone explain this syntax...
What does it mean to have two equal signs next to each other?
eg: Code:
and what us the stuff after the ? Code:
Thanks!~ |
|
#2
|
||||||||||||
|
||||||||||||
|
Here is the answer according my understanding
Code:
Am i correct?
__________________
meelan ;-) Last edited by MEELAN : 08-29-2004 at 11:42 AM. |
|
#3
|
||||||||||||
|
||||||||||||
|
Quote:
What language Brian? Is that php? Definitely makes a diff. Most languages follow similiar rules, but the syntax def varies. |
|
#4
|
|||||||||||
|
|||||||||||
|
yes, it is PHP. Probably should have indicated that in my 1st post :angel:
|
|
#5
|
||||
|
||||
|
$var = 1 sets the value of $var to 1.
$var == 1 compares the value of $var to 1 |
|
#6
|
||||||||||||
|
||||||||||||
|
Quote:
Brian, If you are going to be coding in php. phpbuilder.org is a good place to start. Lotsof stuff on php. You need a semi colon after that statement or it won't work. Basically, You are assigning a variable then telling it to evaluate that based on the comparison operators on that variable. This is straight out of the manual under comparison operators. This is the newest syntax. $a == $b Equal TRUE if $a is equal to $b. Another conditional operator is the "?:" (or ternary) operator, which operates as in C and many other languages. (expr1) ? (expr2) : (expr3); This expression evaluates to expr2 if expr1 evaluates to TRUE, and expr3 if expr1 evaluates to FALSE. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|