number validation integer floating point number real number minimum value maximum value

number validation

No more, no less - validates numbers. Supports scientific notation too!


<?php

$config 
= Array(  

  
'element' => Array(  

    
'type' => '...',  
    
// ...further element settings here...  

    
'validation' => Array(   

      Array(
        
'type'     => 'number',
        
'required' => 1// required or not (number or empty), default: 1
        
'minimum'  => 2// minimum value, negative numbers too
        
'maximum'  => 5// maximum value
        
'real'     => 'sci'
        
// Defines notation allowed: 
        // 0 - integers only,
        // 1 - integers or real, eg. 12 or 2.3
        // sci - scientific/hex notation: 123.03E+35, 0xFA235F
        
'help'     => 'Help message value for this validator only'
      
)

    )
  )
);

?>


Live examples:

form validation for developers!

clonefish is a proven, mature form generator class that helps PHP developers to create, validate and process secure, flexible and easy-to-maintain forms
learn more
Bookmark and Share