Jason Pruim wrote:
Or, seeing as I'm a stickler for compact code:

if(!empty($_SESSION['userInfo']['loggedin'])) {

empty() is like isset() but tests for all sorts of "empty" cases ('', false, null and 0 are all considered, "empty").

Hey Colin,

Does the ! reverse the empty in this case? such as !empty = not empty?

Yes. That's what the ! always does. It's the "not" operator in PHP (and most languages):

http://uk3.php.net/manual/en/language.operators.logical.php

Col

--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to