public function rule_true($a)
    {
        // Changes PHP true to 1
        $a = strtolower($a);

        $vals = array('true', 't', 1, 'yes', 'y');

        if (!in_array($a, $vals)) {
            return $this->fail('Must be true');
        }
    }
public function rule_true($a)
    {
        // Changes PHP true to 1
        $a = strtolower($a);

        $vals = array('true', 't', 1, 'yes', 'y');

        if (!in_array($a, $vals)) {
            return $this->fail('Must be true');
        }
    }
public function rule_true ( $ a ) { // Changes PHP true to 1 $ a = strtolower ( $ a ) ; $ vals = array ( 'true' , 't' , 1 , 'yes' , 'y' ) ; if ( ! in_array ( $ a , $ vals ) ) { return $ this -> fail ( 'Must be true' ) ; } }
Validate for true|t|1|yes|y.

Normalizes to lower case

Useful for 'if' rules
Validate for true|t|1|yes|y .