joomla/joomla-platform — pull request #1556 by pasamio (2012-09-27 22:49:00+00:00)
Title: Add JArrayHelper::invert

This adds a new method to JArrayHelper called 'invert'. The 'invert' method provides the ability to provide an associative array of arrays and then make the values in those arrays the keys with the key from the input associative array as the value for those entries.

So if we use the following code:
```
$input = array(
'New' => array('1000', '1500', '1750'),
'Used' => array('3000', '4000', '5000', '6000')
);
$output = JArrayHelper::invert($input);
```

The result for output would be equal to:
```
$output = array(
'1000' => 'New',
'1500' => 'New',
'1750' => 'New',
'3000' => 'Used',
'4000' => 'Used',
'5000' => 'Used',
'6000' => 'Used'
);
```

This provides a quick means of a slightly more powerful 'array_flip' method where multiple values are concerned.