I’d love to know what this means so I can google it as I see it all the time and it seems to be very useful
(($winstate==1)?'X':'O')
edit: The vars are irrelevant.
Thanks guys
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That’s called a ternary operator, it’s PHP’s only ternary operator, and it’s shorthand for a conditional:
It’s frequently used when the conditional test results in an assignment or returns something, in this case suppose you wanted to assign ‘X’ or ‘O’ to a variable
$move, it’s far more concise to write: