Re: [PHP] why true?

2002-08-11 Thread Rasmus Lerdorf
Because you are comparing a string to a number. PHP has to choose to either compare the two as strings or as numbers. The numerical value of the string 'test' is 0 which means it works out to 0 == 0 which is true. If you want to force a string comparison, you can use strcmp() or, if you want

RE: [PHP] why true?

2002-08-11 Thread Maxim Maletsky
Try echo ('test'=='0'); and you'll see what Rasmus meant. Sincerely, Maxim Maletsky PHP Beginner www.phpbeginner.com -Original Message- From: Bas Jobsen [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 11, 2002 4:56 PM To: PHP General Subject: [PHP] why true? echo