i have a few string variables that contain numbers. $string1 = "30" $string2 = "40"
What is the right function to convert these strings to ints so i can
$string1 + $string2 = $int1
and $int1 will equal 70
settype()
thank you, i knew it was easy...
...or
$int1=0+$string1+$string2;
$int1=$string1+$string2; is quite sufficient. PHP's string contantenation operaotr is '.'. PHP sees the '+' and thinks: "Hmm... arithmetic operator. Needs numeric arguments..."