0
how can string variable and a integer can be added?
if $str="10"; and $int=20 then how the output becomes 30
2 Answers
+ 2
Bishal Shrestha
PHP will automatically change the type when you enter a number as a string.
https://www.sololearn.com/learn/PHP/1796/
+ 1
Use . instead of + for adding strings. $str . $int equals to "1020".