note 34665 deleted from control-structures.alternative-syntax by didou
| From: | didou@php.net | Date: | Sun, 03 Aug 2003 09:58:43 +0000 |
| Subject: | note 34665 deleted from control-structures.alternative-syntax by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-53235@lists.php.net to get a copy of this message | ||
Note Submitter: corrupted_wise@yahoo.com
----
Another type of if/else syntax i found, is much like it's perl counterpart. Here's an
example.
This is your normal if/else
if(statement is true) {
$variable = 1;
} else {
$variable = 0;
}
Alternative:
$variable = (statement is true) ? 1 : 0;
Both do the same thing. This took me a while to figure out as no one really talked about it.