fuel/fuel/core/classes/database/connection.php
protected function _parse_type($type)
	{
		if (($open = strpos($type, '(')) === false)
		{
			// No length specified
			return array($type, null);
		}

		// Closing parenthesis
		$close = strpos($type, ')', $open);

		// Length without parentheses
		$length = substr($type, $open + 1, $close - 1 - $open);

		// Type without the length
		$type = substr($type, 0, $open).substr($type, $close + 1);

		return array($type, $length);
	}
protected function _parse_type($type)
	{
		if (($open = strpos($type, '(')) === false)
		{
			// No length specified
			return array($type, null);
		}

		// Closing parenthesis
		$close = strpos($type, ')', $open);

		// Length without parentheses
		$length = substr($type, $open + 1, $close - 1 - $open);

		// Type without the length
		$type = substr($type, 0, $open).substr($type, $close + 1);

		return array($type, $length);
	}
protected function _parse_type ( $ type ) { if ( ( $ open = strpos ( $ type , '(' ) ) === false ) { // No length specified return array ( $ type , null ) ; } // Closing parenthesis $ close = strpos ( $ type , ')' , $ open ) ; // Length without parentheses $ length = substr ( $ type , $ open + 1 , $ close - 1 - $ open ) ; // Type without the length $ type = substr ( $ type , 0 , $ open ) . substr ( $ type , $ close + 1 ) ; return array ( $ type , $ length ) ; }
Extracts the text between parentheses, if any.

// Returns: array('CHAR', '6')
list($type, $length) = $db->_parse_type('CHAR(6)');

@param string $type

@return  array   list containing the type and length, if any
Extracts the text between parentheses if any .