Created
May 24, 2017 04:00
-
-
Save YurePereira/cddd46437c96f6fc2a89e7e4a72b2dcd to your computer and use it in GitHub Desktop.
Usando o laço de repetiçã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 | |
| //Primeira sintaxe: | |
| foreach ($array as $value) { | |
| echo 'Valor: ' . $value . PHP_EOL; | |
| } | |
| //Segunda sintaxe: | |
| foreach ($array as $key => $value) { | |
| echo 'Chave: ' . $key . ', Valor: ' . $value . PHP_EOL; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment