I have this variable:
$logged_in_person_rsvp - its value = -1
Then I run this code:
$yes_checked = ($logged_in_person_rsvp===1) ? "checked" : ""; $maybe_checked = ($logged_in_person_rsvp===-1) ? "checked" : ""; $no_checked = ($logged_in_person_rsvp===0) ? "checked" : ""; echo '<p>logged_in_person_rsvp: '.$maybe_checked.'</p>';
And I get output as nothing. But I was expecting the output to be -1
Anyone understand why? This is weird syntax I inherited :)
Try using two equals signs like "==" instead of 3 and see if that makes a difference. If so, your strict comparison is probably messing up your intended result.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki