Re: [PHP] is_null() and is_string() reversed when using in switch case statements... [SOLVED]

2011-07-15 Thread Jim Lucas
On 7/14/2011 7:44 PM, Daevid Vincent wrote: > Ah! Thanks Simon! That is exactly right. Doh! I should have thought of > that... *smacks head* > > Here is the fruit of my labor (and your fix)... > > /** > * Useful for debugging functions to see parameter names, etc. > * Based upon http://www.php.

RE: [PHP] is_null() and is_string() reversed when using in switch case statements... [SOLVED]

2011-07-14 Thread Daevid Vincent
> -Original Message- > From: Simon J Welsh [mailto:si...@welsh.co.nz] > Sent: Thursday, July 14, 2011 7:29 PM > To: Daevid Vincent > Cc: php-general@lists.php.net > Subject: Re: [PHP] is_null() and is_string() reversed when using in switch > case statements... >

Re: [PHP] is_null() and is_string() reversed when using in switch case statements...

2011-07-14 Thread Simon J Welsh
On 15/07/2011, at 1:58 PM, Daevid Vincent wrote: > function test($v) > { > var_dump($v); > > if (is_string($v)) echo "FOUND A STRING.\n"; > if (is_null($v)) echo "FOUND A NULL.\n"; > > switch ($v) > { > case is_string($v): > echo

[PHP] is_null() and is_string() reversed when using in switch case statements...

2011-07-14 Thread Daevid Vincent
Can someone double check me here, but I think I found a bug... int 1 1 => int 2 2 => int 3 3 => int 4 4 => int 5 I think v is an array [1,2,3,4,5] */ ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] is_null question

2002-07-12 Thread Jason White
f after Email"; print $temp; Jason White - Original Message - From: "Jason White" <[EMAIL PROTECTED]> To: "Matthew K. Gold" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, July 12, 2002 9:28 PM Subject: Re: [PHP] is_null question > You

Re: [PHP] is_null question

2002-07-12 Thread Jason White
You can use: if($row[1]){print "Email:$row[1]";}else{print " ";} Jason White - Original Message - From: "Matthew K. Gold" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, July 12, 2002 9:23 PM Subject: [PHP] is_null question > Hi

[PHP] is_null question

2002-07-12 Thread Matthew K. Gold
Hi Everyone, Here's my problem: I'd like to make the printing of some text dependent on whether or not a variable is null. In the following example, when $row[1] is null, what gets printed on the page is "Email: ". I'd like the script to not print "Email:" if row[1] is null. It looks like

Re: [PHP] is_null misses spaces... SOLUTION!

2001-11-13 Thread Spunk S. Spunk III
Ahh... and the winner is empty(). Thanks Christian for this elusive answer and everyone else for their input. Spunk > > I need to check variables for blank values but it appears that is_null and > =="" return true if there is a space. > > Any other suggestions? > > Thanks > > > -- > PHP

[PHP] is_null misses spaces... another solution?

2001-11-13 Thread Spunk S. Spunk III
I need to check variables for blank values but it appears that is_null and =="" return true if there is a space. Any other suggestions? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To cont

Re: [PHP] is_null

2001-04-12 Thread Plutarck
It doesn't tell you if a variable is actually null, but unless you specifically need to know if it is actually "NULL", just testing for truth is usually enough. For most uses it works fine, but if you really need to know wether or not it's null, take one of the other suggestions. For instance,

Re: [PHP] is_null

2001-04-12 Thread CC Zona
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Jennifer) wrote: > I wanted to use is_null, but it isn't available in my version > (4.0B2) > > What would be an equivalent? I'm fairly new to PHP. > > I was using isset, but sometimes it is set to Null. > > Null values are unacceptable, but

Re: [PHP] is_null

2001-04-12 Thread Yasuo Ohgaki
It's supported from 4.0.4, I think. Regards, -- Yasuo Ohgaki "Jennifer" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I wanted to use is_null, but it isn't available in my version > (4.0B2) > > What would be an equivalent? I'm fairly new to PHP. > > I was

[PHP] is_null

2001-04-12 Thread Jennifer
I wanted to use is_null, but it isn't available in my version (4.0B2) What would be an equivalent? I'm fairly new to PHP. I was using isset, but sometimes it is set to Null. Null values are unacceptable, but zero is a perfectly acceptable value for what I want. Jennifer -- PHP General Maili