Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://old.hcs.cmc.msu.ru/php/function.empty.html
Дата изменения: Sun Feb 3 22:57:05 2002 Дата индексирования: Mon Oct 1 21:05:31 2012 Кодировка: |
Note: empty() is a language construct.
This is the opposite of (boolean) var, except that no warning is generated when the variable is not set. See converting to boolean for more information.
$var = 0; if (empty($var)) { // evaluates true echo '$var is either 0 or not set at all'; } if (!isset($var)) { // evaluates false echo '$var is not set at all'; } |
Note that this is meaningless when used on anything which isn't a variable; i.e. empty (addslashes ($name)) has no meaning since it would be checking whether something which isn't a variable is a variable with a FALSE value.