note 82853 deleted from control-structures.continue by nlopess
| From: | nlopess@php.net | Date: | Tue, 29 Apr 2008 18:03:25 +0000 |
| Subject: | note 82853 deleted from control-structures.continue by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-138905@lists.php.net to get a copy of this message | ||
Note Submitter: snuffle at hotmail dot com
----
bennet at mc dot edu:
I think you missed the exclamation mark at the start of the if expression, which inverts the logical
output of the expression.
<?php
if ( ! ($key % 2) ) {
continue;
}
?>
...Means if the key is NOT even, ie if it is odd, so the first example is actually correct, whereas
your interpretation of it isn't.