Created
May 26, 2017 20:08
-
-
Save YurePereira/47e40ccf8cf7f4d28ebf9e4a9d5e30da to your computer and use it in GitHub Desktop.
Usando o comando continue no laço foreach.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $frults = array( | |
| 'Pineapple', | |
| 'Cashew', | |
| 'Apple', | |
| 'Strawberry' | |
| ); | |
| foreach ($frults as $value) { | |
| if ($value === 'Cashew') { | |
| continue; | |
| } | |
| echo $value . PHP_EOL; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment