For mysqlnd it's very easy, just set options for your opened db connection:
$mysqli->options(MYSQLI_OPT_INT_AND_FLOAT_NATIVE,1);