Skip to content

Instantly share code, notes, and snippets.

@caioerick
Created May 3, 2014 02:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caioerick/1e0d5cc6763c2aa67aea to your computer and use it in GitHub Desktop.
Save caioerick/1e0d5cc6763c2aa67aea to your computer and use it in GitHub Desktop.
<?php
$a = Array("Caio", " Erick", " Braga", " Costa");
echo $a[0].$a[1].$a[2].$a[3]; // Imprimindo meu nome
for($i=0;$i<4;$i++) {
echo $a[$i];
}
// Imprimindo meu nome com for();
for($i=0;$i<count($a);$i++) {
echo $a[$i];
}
// Imprimindo meu nome com for() e usando a função count() pra contar a quantidade de posições que existe no Array.
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment