protected function parseRule($rule, $min, $max)
    {
        $result = [];

        foreach (explode(',', $rule) as $value) {
            if (preg_match('/^([0-9]+)-([0-9]+)$/', $value, $r)) {
                $result = array_merge($result, range($r[1], $r[2]));
            } elseif (preg_match('/^\*\/([0-9]+)$/', $value, $r)) {
                for ($i = $min; $i <= $max; $i++) {
                    if ($i % $r[1] == 0) {
                        $result[] = $i;
                    }
                }
            } elseif (is_numeric($value)) {
                $result[] = $value;
            }
        }

        return $result;
    }
protected function parseRule($rule, $min, $max)
    {
        $result = [];

        foreach (explode(',', $rule) as $value) {
            if (preg_match('/^([0-9]+)-([0-9]+)$/', $value, $r)) {
                $result = array_merge($result, range($r[1], $r[2]));
            } elseif (preg_match('/^\*\/([0-9]+)$/', $value, $r)) {
                for ($i = $min; $i <= $max; $i++) {
                    if ($i % $r[1] == 0) {
                        $result[] = $i;
                    }
                }
            } elseif (is_numeric($value)) {
                $result[] = $value;
            }
        }

        return $result;
    }
protected function parseRule ( $ rule , $ min , $ max ) { $ result = [ ] ; foreach ( explode ( ',' , $ rule ) as $ value ) { if ( preg_match ( '/^([0-9]+)-([0-9]+)$/' , $ value , $ r ) ) { $ result = array_merge ( $ result , range ( $ r [ 1 ] , $ r [ 2 ] ) ) ; } elseif ( preg_match ( '/^\*\/([0-9]+)$/' , $ value , $ r ) ) { for ( $ i = $ min ; $ i <= $ max ; $ i ++ ) { if ( $ i % $ r [ 1 ] == 0 ) { $ result [ ] = $ i ; } } } elseif ( is_numeric ( $ value ) ) { $ result [ ] = $ value ; } } return $ result ; }
Convert a rule to an array of all its values.

@param string $rule
@param int    $min
@param int    $max

@return array
Convert a rule to an array of all its values .