Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Deletando posições de um array
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