I thought doubles and floats are the same in PHP? Am I missing something?  Besides that this if checks could be left out I think as it quotes all kind of strings with the driver function.