Created
May 19, 2014 15:20
-
-
Save valdiney/f1eb082f006d5dcbb11a to your computer and use it in GitHub Desktop.
Deletando posições de um array
This file contains 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
function retira( $array, $posicao ) { | |
if( array_key_exists( $posicao, $array ) ) { | |
unset( $array[ $posicao ] ); | |
return $array; | |
} | |
} | |
$arr = array(80,10,10); | |
$soma1 = 0; | |
$soma2 = 0; | |
foreach ($arr as $value) { | |
$soma1 += $value; | |
} | |
echo $soma1; | |
echo "<br>"; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment