src/utils/Options.php
public function parse($input)
		{
			$output = [];
			$options = explode('|', $input);
			foreach($options as $option)
			{
				$name = $option;
				$value = 1;
				if(strpos($option, ':') !== false)
				{
					list($name, $value) = explode(':', $option, 2);
				}
				if (strstr($value, ',') !== false)
				{
					$values = explode(',', $value);
					if (strstr($value, '=') !== false)
					{
						$pairs = [];
						foreach($values as $value)
						{
							list($n, $v) = explode('=', $value, 2);
							$pairs[$n] = $v;
						}
						$values = $pairs;
					}
					$value = $values;
				}
				$output[$name] = $value;
			}
			return $output;
		}
public function parse($input)
		{
			$output = [];
			$options = explode('|', $input);
			foreach($options as $option)
			{
				$name = $option;
				$value = 1;
				if(strpos($option, ':') !== false)
				{
					list($name, $value) = explode(':', $option, 2);
				}
				if (strstr($value, ',') !== false)
				{
					$values = explode(',', $value);
					if (strstr($value, '=') !== false)
					{
						$pairs = [];
						foreach($values as $value)
						{
							list($n, $v) = explode('=', $value, 2);
							$pairs[$n] = $v;
						}
						$values = $pairs;
					}
					$value = $values;
				}
				$output[$name] = $value;
			}
			return $output;
		}
public function parse ( $ input ) { $ output = [ ] ; $ options = explode ( '|' , $ input ) ; foreach ( $ options as $ option ) { $ name = $ option ; $ value = 1 ; if ( strpos ( $ option , ':' ) !== false ) { list ( $ name , $ value ) = explode ( ':' , $ option , 2 ) ; } if ( strstr ( $ value , ',' ) !== false ) { $ values = explode ( ',' , $ value ) ; if ( strstr ( $ value , '=' ) !== false ) { $ pairs = [ ] ; foreach ( $ values as $ value ) { list ( $ n , $ v ) = explode ( '=' , $ value , 2 ) ; $ pairs [ $ n ] = $ v ; } $ values = $ pairs ; } $ value = $ values ; } $ output [ $ name ] = $ value ; } return $ output ; }
Converts string options to a hash

Operation:

- splits options by |
- splits arguments by :
- splits argument members by ,
- splits argument member names and values by =

Example:

index|html:path|pre:path,methods|values:One=1,Two=2,Three=3

@param $input
@return array
Converts string options to a hash