public static function ArrayHelper::transformAssociativeValues in Helper 7
1 call to ArrayHelper::transformAssociativeValues()
File
- lib/
ArrayHelper.php, line 97
Class
Code
public static function transformAssociativeValues(array $array1, array $array2, $value_if_not_exists = NULL) {
$return = array();
foreach ($array1 as $key => $value) {
$return[$key] = array_key_exists($value, $array2) ? $array2[$value] : $value_if_not_exists;
}
return $return;
}