Posted By

sveggiani on 01/05/09


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

umang_nine


evValidFloat | checks if a given string has a valid FLOAT format


 / Published in: PHP
 

  1. // name: evValidFloat
  2. // version: v0.1
  3. // description: chequea que sea un float
  4.  
  5. function evValidFloat( $val ) {
  6.  
  7. if ( preg_match( '/^[0-9]+(?:\.[0-9]{2})?$/', $val ) ) return true;
  8. else return false;
  9.  
  10. }

Report this snippet  

You need to login to post a comment.