> -----Original Message-----
> From: Amanda McComb [mailto:[EMAIL PROTECTED]
> Sent: 12 June 2003 22:21
> 
> Is there a way to make a variable not exist?  There are several places
> where I test (!$variable), and I want to be able to change the
> variable to pass that test, even though it exists, under certain
> circumstances.

Well, the following values will all cause that test to succeed:

  0
  0.0
  ''
  '0'
  array()
  FALSE
  NULL

so take your pick!

Personally, I tend to use NULL in this situation, because it fails isset(),
is detectable with is_null(), and, crucially, doesn't generate a notice on
doing if($variable).

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

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

Reply via email to