Re: [PHP] if (a == b) ...

2003-01-30 Thread Ernest E Vogelsinger
At 02:36 30.01.2003, Webapprentice said: [snip] >Hi, >I have a conditional: >if (a == b) > >a is the number 0, but b is a string "Friday August 22". > >The condition is evaluating as true, which is not what I want. >What am I misunderstanding? ---

RE: [PHP] if (a == b) ...

2003-01-29 Thread Lee Herron
$a === $b TRUE if $a is equal to $b, and they are of the same type. (PHP 4 only) > -Original Message- > From: David Freeman [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 29, 2003 7:39 PM > To: [EMAIL PROTECTED] > Subject: RE: [PHP] if (a == b) ... > &

Re: [PHP] if (a == b) ...

2003-01-29 Thread Webapprentice
Cal, Thanks for the suggestion. I looked up equality on www.php.net, and there are many comments about how == works. I also found out === works too, or is that still lazy? Thanks, Stephen Cal Evans wrote: Stephen, "Friday August 22" evaluates to the number 0. (check the docs for intval()) The

RE: [PHP] if (a == b) ...

2003-01-29 Thread Cal Evans
, 2003 7:36 PM To: [EMAIL PROTECTED] Subject: [PHP] if (a == b) ... Hi, I have a conditional: if (a == b) a is the number 0, but b is a string "Friday August 22". The condition is evaluating as true, which is not what I want. What am I misunderstanding? Thanks, Stephen -- PHP General Mail

Re: [PHP] if (a == b) ...

2003-01-29 Thread Johannes Schlueter
On Thursday 30 January 2003 02:39, David Freeman wrote: > -8<- > $a = "0"; > $b = "Friday August 22"; > -8<- > > and resulted in 'no match'. Or try $a = 0; $c = (string) $a; // Now $c == "0" or if (( (string) $a == (string) $b)) { ... The manual could be your friend, to

RE: [PHP] if (a == b) ...

2003-01-29 Thread David Freeman
> I have a conditional: > if (a == b) > > a is the number 0, but b is a string "Friday August 22". > > The condition is evaluating as true, which is not what I want. > What am I misunderstanding? You're comparing a string to a number perhaps? I tried this: -8<- $a = 0; $b = "Frid

[PHP] if (a == b) ...

2003-01-29 Thread Webapprentice
Hi, I have a conditional: if (a == b) a is the number 0, but b is a string "Friday August 22". The condition is evaluating as true, which is not what I want. What am I misunderstanding? Thanks, Stephen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.ne