+ 1
If I add 20+10a it shows 30 but for 20+a10 it shows 20 o.O why is this?
2 ответов
+ 5
because u cant add integer and string but php try to convert that string into integer so if u hav a string name b having value "10 days" and u do echo $a+$b it will print 20 if $a having 10 value it ignore days or anythinh after that integer value so it works in ur case but didnt work when u hav any character follow by number
- 2
because in a10, "a" is a string and place on before of integer