public static function toBoolean($obj, $skipNull = false)
    {
        if ($skipNull && is_null($obj)) {
            return null;
        }

        return filter_var($obj, FILTER_VALIDATE_BOOLEAN);
    }
public static function toBoolean($obj, $skipNull = false)
    {
        if ($skipNull && is_null($obj)) {
            return null;
        }

        return filter_var($obj, FILTER_VALIDATE_BOOLEAN);
    }
public static function toBoolean ( $ obj , $ skipNull = false ) { if ( $ skipNull && is_null ( $ obj ) ) { return null ; } return filter_var ( $ obj , FILTER_VALIDATE_BOOLEAN ) ; }
Converts string into boolean value.

@param string $obj       boolean value in string format.
@param bool   $skipNull  If $skipNull is set, will return NULL directly
when $obj is NULL.

@return bool
Converts string into boolean value .