Easy way to check that something is a number w/ max 2 decimal places of accuracy?

Posted by aslum on Stack Overflow See other posts from Stack Overflow or by aslum
Published on 2010-04-05T19:04:58Z Indexed on 2010/04/05 19:13 UTC
Read the original article Hit count: 284

Filed under:

I want to make sure the input is A)a number and B)has at most 2 decimals. $number[$i]=int(100*$number[$i])/100;
I imagine there is a more efficient way to do this... any suggestions? (using PHP).

© Stack Overflow or respective owner

Related posts about php