[PHP] isset opposite
Hi there.. I am pretty new to PHP, and I am familiar with php isset option now i was wondering (I have looked at the PHP site - but can not find it) how can you check if something is not set? I need to test if a $_GET is not set (not just empty). thanks in advance! d -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] isset opposite
Hi there.. I am pretty new to PHP, and I am familiar with php isset option now i was wondering (I have looked at the PHP site - but can not find it) how can you check if something is not set? I need to test if a $_GET is not set (not just empty). thanks in advance! d I'm sure I'll be one of the many who says this: !isset The ! means not. You can use it with most of the functions like !empty (not empty). So you can use it like so: if (!isset($_GET[var])) { do stuff } -- --Matthew Sims --http://killermookie.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] isset opposite
On Tue, 16 Nov 2004 15:11:39 -0800, Dustin Krysak [EMAIL PROTECTED] wrote: how can you check if something is not set? !isset() -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] isset opposite
On Nov 16, 2004, at 5:11 PM, Dustin Krysak wrote: Hi there.. I am pretty new to PHP, and I am familiar with php isset option now i was wondering (I have looked at the PHP site - but can not find it) how can you check if something is not set? I need to test if a $_GET is not set (not just empty). !array_key_exists('yourkey', $_GET); -ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] isset opposite
On Tue, 2004-11-16 at 15:11 -0800, Dustin Krysak wrote: Hi there.. I am pretty new to PHP, and I am familiar with php isset option now i was wondering (I have looked at the PHP site - but can not find it) how can you check if something is not set? I need to test if a $_GET is not set (not just empty). thanks in advance! d isset() returns a boolean. so...try, if (!isset($x)) -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] isset opposite
Thanks! perfect! d On 16-Nov-04, at 4:13 PM, Robby Russell wrote: On Tue, 2004-11-16 at 15:11 -0800, Dustin Krysak wrote: Hi there.. I am pretty new to PHP, and I am familiar with php isset option now i was wondering (I have looked at the PHP site - but can not find it) how can you check if something is not set? I need to test if a $_GET is not set (not just empty). thanks in advance! d isset() returns a boolean. so...try, if (!isset($x)) -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] isset opposite
On Tue, 2004-11-16 at 17:19 -0800, Dustin Krysak wrote: Thanks! perfect! d For future reference, just about any function that uses is at the beginning should return a boolean result. So if (is_array()) can also be checked with if (!is_array()) This should apply to all the php included functions that start with is. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] isset opposite
Yeah as soon as I saw this example, I figured that was the case for example something like if (!empty()) and so on. d On 16-Nov-04, at 5:26 PM, Robby Russell wrote: On Tue, 2004-11-16 at 17:19 -0800, Dustin Krysak wrote: Thanks! perfect! d For future reference, just about any function that uses is at the beginning should return a boolean result. So if (is_array()) can also be checked with if (!is_array()) This should apply to all the php included functions that start with is. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php