in php it is very easy.. all you need to do is request to your string to be an integer..
$str = "23";
$result = $str + 2;
// now $result = 25 integer
if you want to be sure that your $str var is an integer, do:
$str = "23";
$str = (int) $str;
// now $str = 23 integer
php is very smart with that:
$value = "33.0 years" + 1.0;
// so $value = 34.0 float
you can convert all types in all other types:
(int), (integer)
(real), (double), (float)
(string)
(array)
(object)