recent searches:
include functions ,
variable functions ,
post functions...
If you are new to PHP or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to create a simple PHP website.
PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.
unset() destroys the specified variables. Note that in PHP 3, unset() will always return TRUE (actually, the integer value 1). In PHP 4, however, unset() is no longer a true function: it is now a statement. As such no value is returned, and attempting to take the value of unset() results in a parse error.
Note: It is possible to unset even object properties visible in current context.
The behavior of unset() inside of a function can vary depending on what type of variable you are attempting to destroy.
If a globalized variable is unset() inside of a function, only the local variable is destroyed. The variable in the calling environment will retain the same value as before unset() was called.
The above example will output:
If you would like to unset() a global variable
inside of a function, you can use
the $GLOBALS array to do so:
If a variable that is PASSED BY REFERENCE is unset() inside of a function, only the local variable is destroyed. The variable in the calling environment will retain the same value as before unset() was called.
<?php |
The above example will output:
If a static variable is unset() inside of a function, unset() destroys the variable only in the context of the rest of a function. Following calls will restore the previous value of a variable.
<?php |
The above example will output:
Note: Because this is a language construct and not a function, it cannot be called using variable functions
See also isset(), empty(), and array_splice().
Another Useful functions:
zend-api.zend-unset-timeout | zend-api.zend-std-unset-static-property | zend-api.add-property-unset | zend-api.add-next-index-unset | zend-api.add-index-unset | zend-api.add-assoc-unset | language.references.unset | function.unset | function.session-unset | function.phar-offsetunset | function.date-sunset | function.arrayobject-offsetunset |
PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.