public function getVersionComponents($data)
    {
        $string = str_replace(' ', '', $data);

        $matches = array();
        preg_match_all('/(^(==|=|!=|<>|>|<|>=|<=)?(?=\d))(.*)/', $string, $matches);

        if (empty($matches[3][0])) {
            return array();
        }

        $operator = empty($matches[2][0]) ? '=' : $matches[2][0];
        return array($operator, $matches[3][0]);
    }
public function getVersionComponents($data)
    {
        $string = str_replace(' ', '', $data);

        $matches = array();
        preg_match_all('/(^(==|=|!=|<>|>|<|>=|<=)?(?=\d))(.*)/', $string, $matches);

        if (empty($matches[3][0])) {
            return array();
        }

        $operator = empty($matches[2][0]) ? '=' : $matches[2][0];
        return array($operator, $matches[3][0]);
    }
public function getVersionComponents ( $ data ) { $ string = str_replace ( ' ' , '' , $ data ) ; $ matches = array ( ) ; preg_match_all ( '/(^(==|=|!=|<>|>|<|>=|<=)?(?=\d))(.*)/' , $ string , $ matches ) ; if ( empty ( $ matches [ 3 ] [ 0 ] ) ) { return array ( ) ; } $ operator = empty ( $ matches [ 2 ] [ 0 ] ) ? '=' : $ matches [ 2 ] [ 0 ] ; return array ( $ operator , $ matches [ 3 ] [ 0 ] ) ; }
Extracts an array of components from strings like ">= 1.0.0"
@param string $data
@return array
Extracts an array of components from strings like > = 1 . 0 . 0