Validation::boolean PHP 메소드

boolean() 공개 정적인 메소드

public static boolean ( $value )
    public static function boolean($value)
    {
        $boolean = array(0, 1, '0', '1', true, false);
        return in_array($value, $boolean, true);
    }

Usage Example

예제 #1
0
 /**
  * @testdox boolean should return false to true as string
  */
 public function testInvalidBooleanWithTrue()
 {
     $value = 'true';
     $this->assertFalse(Validation::boolean($value));
 }
All Usage Examples Of Validation::boolean