Getting variable from form:
if you prefer mantain a wide type compatibility and preserve input types other than int (double, float, ecc.) i suggest something like this:
$var = is_numeric($_POST['a'])?$_POST['a']*1:$_POST['a'];
You will get:
$_POST['a'] = "abc"; // string(3) "abc"
$_POST['a'] = "10"; // int(10)
$_POST['a'] = "10.12"; // float(10.12)