Skip to content

Instantly share code, notes, and snippets.

@YurePereira
Created May 26, 2017 20:08
Show Gist options
  • Select an option

  • Save YurePereira/47e40ccf8cf7f4d28ebf9e4a9d5e30da to your computer and use it in GitHub Desktop.

Select an option

Save YurePereira/47e40ccf8cf7f4d28ebf9e4a9d5e30da to your computer and use it in GitHub Desktop.
Usando o comando continue no laço foreach.
<?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