JArrayHelper::invert
Takes an associative array of arrays and inverts the array keys to values using the array values as keys.
Example: $input = array( 'New' => array('1000', '1500', '1750'), 'Used' => array('3000', '4000', '5000', '6000') ); $output = JArrayHelper::invert($input); Output would be equal to: $output = array( '1000' => 'New', '1500' => 'New', '1750' => 'New', '3000' => 'Used', '4000' => 'Used', '5000' => 'Used', '6000' => 'Used' );
Signature
public function invert(array
$array )
Parameters
-
$array
- The source array.
Returns
- array
- The inverted array.