[PHP-DEV] == Comparison type juggling

2011-04-22 Thread Matt Pelmear
I'm sure this has probably been covered here in the past, but I've been unable to find a good way to search for it, so I'll just ask. if( '2011020402421730' === '20110204024217300264' ) echo 'BAD'; else echo 'GOOD'; results in GOOD being echoed. However, if( '2011020402421730' ==

Re: [PHP-DEV] == Comparison type juggling

2011-04-22 Thread Alain Williams
On Fri, Apr 22, 2011 at 10:27:33AM -0400, Matt Pelmear wrote: My questions are: 1) What is the advantage to converting both strings to ints to compare them? It makes things easy for working on what comes back from a form (in $_POST/...). It is a nice feature, and works well *most* of the time.

Re: [PHP-DEV] == Comparison type juggling

2011-04-22 Thread Brian Moon
or strcmp() yeah, strcmp is your friend there. Brian. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php