Hello Dave, Wednesday, April 7, 2004, 2:41:15 AM, you wrote:
MD> Okay seems to makes sense, but when I do the following it doesn't appear to MD> be working correctly, or I'm viewing my logic incorrectly one: MD> if ( (int)$PageOptions['Default'] == $PageOptions['Default'] ) { MD> // display a message if the integer of the default value matches the MD> default value } MD> Enter 5, message displayed, so correct MD> Enter 5.0, messaged displayed, incorrect MD> Enter 5.5, no message, so correct MD> Enter a, message displayed, incorrect MD> Enter 5.0a, message displayed, incorrect MD> Enter 5.5a, no message, so correct MD> Enter a5.5, message displayed, incorrect MD> What am I missing here? When casting to an Integer don't forget it will loose any floating point value, so 5.0 becomes 5 which according to above will display a message. 5.0a will cast to 5, 5.5a should also cast to 5, but might be rounding the wrong way? a5.5 will cast to 0. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php