Numbers in Quotes in PHP
As you know, a number in quotes represents
a string. For example, '3' is
a string. However, when comparing such strings
with real numbers, PHP considers that the string
in quotes is equal to the same number.
Let's compare the string '3'
and the number 3 as an example:
<?php
if ('3' == 3) {
echo '+++'; // this will trigger - the values are equal
} else {
echo '---';
}
?>