Função PHP unset()
❮ Referência de Manipulação de Variáveis PHP
Exemplo
Variáveis não definidas:
<?php
$a = "Hello world!";
echo
"The value of variable 'a' before unset: " . $a . "<br>";
unset($a);
echo
"The value of variable 'a' after unset: " . $a;
?>
Definição e uso
A função unset() desabilita uma variável.
Sintaxe
unset(variable, ....);
Valores de parâmetro
Parameter | Description |
---|---|
variable | Required. Specifies the variable to unset |
... | Optional. Another variable to unset |
Detalhes técnicos
Valor de retorno: | Nenhum |
---|---|
Tipo de retorno: | Nenhum |
Versão do PHP: | 4.0+ |
❮ Referência de Manipulação de Variáveis PHP