Last active
June 9, 2017 07:41
-
-
Save laurentsab/600d89968f57376e887b30848d76736a to your computer and use it in GitHub Desktop.
Manipulate keys values in foreach
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @param array $array | |
* | |
* @return array | |
*/ | |
protected function translate($array) | |
{ | |
$filtersChoicesTrans = []; | |
foreach ($array as $key => $value) { | |
$keyToLower = strtolower($key); | |
$filtersChoicesTrans["monolog.event.{$keyToLower}"] = $value; | |
} | |
return $filtersChoicesTrans; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment