Re: if (empty versus if (isset

From: Date: Wed, 20 Feb 2013 08:26:07 +0000
Subject: Re: if (empty versus if (isset
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-320255@lists.php.net to get a copy of this message
isset checks if something is defined or if an array has a key with a value other than null read: http://www.php.net/manual/en/function.isset.php#refsect1-function.isset-returnvalues empty check isset PLUS if the value is not null, false, 0 and wahtever php thinks is empty read: http://www.php.net/manual/en/function.empty.php#refsect1-function.empty-returnvalues You should also checkout array_key_exists read: http://www.php.net/manual/en/function.array-key-exists.php > John Taylor-Johnston <John.Taylor-Johnston@cegepsherbrooke.qc.ca> hat am 20. > Februar 2013 um 03:29 geschrieben: > > > What is the difference between? > > if (empty... http://www.php.net/manual/en/function.empty.php > "Determine > whether a variable is empty" > and > if (isset... http://php.net/manual/en/function.isset.php > "Determine if a > variable is set and is not *|NULL|*" > > I have an <input type="radio" value="something">. > > If it is not checked, it is NOT empty, because it has a value, right? > But it is NOT set, right? > > Is this empty, because it's value is ""? > > <input type="text" value=""> > > Just trying to understand ... :) -- Marco Behnke Dipl. Informatiker (FH), SAE Audio Engineer Diploma Zend Certified Engineer PHP 5.3 Tel.: 0174 / 9722336 e-Mail: marco@behnke.biz Softwaretechnik Behnke Heinrich-Heine-Str. 7D 21218 Seevetal http://www.behnke.biz

« previous php.general (#320255) next »