Re: why is '01' == '1.'?

php.internals

Bart de Boer

20 years ago
Don't forget that one fundamental aspect of PHP is, that it's a web language and thus receives most of its input from the web. Therefore it usually only gets strings as input. Consider ($_POST['intfield1'] == $_POST['intfield2']) Both variables would be strings. Still if someone would input '01' and '1.' you'd want this expression to return true.