S
S
Sergey Zhukov2015-12-01 11:40:49
PHP
Sergey Zhukov, 2015-12-01 11:40:49

'100' == '100.00'?

Gentlemen, help me understand)
Why
'100' == '100.00' //true
and
'100' == '100,00' //false
After all, in both cases, all operands will be converted to int type and everywhere there will be 100

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2015-12-01
@Adobe

Because the comma is not considered a delimiter in PHP, so it cannot cast '100,00' to a number and compares it as a string

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question