2 ms·
Exactly, only I'd suggest checking for the actual number (your example is missing the exponent part) as well as for the non-scientific representation. In my app
by Udo 16y ago
Exactly, only I'd suggest checking for the actual number (your example is missing the exponent part) as well as for the non-scientific representation. In my apps, I simply checked for the first 12 digits (ignoring the point) only, worked pretty well. And I don't believe it's necessary to null the value, prefixing it with something that prevents casting it as a double should be enough (assuming you don't negate this later in your code).
- RobertKohr 16y agoSo the test would be: if(substr(str_replace('.', '', $val), 0, 11)=='22250738585')) Feel free to post the test you do.
- Udo 16y agoYes, that's it. I'm on my mobile right now (sorry) so I can't exactly check my code but as far as I can tell this was exactly the line. Sorry for not being more helpful but I didn't want to post some untested code that I just typed on a crappy touch screen...