Skip to content

Instantly share code, notes, and snippets.

@vedovelli
Created March 2, 2015 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vedovelli/c3b5152dbf8f8d6862ea to your computer and use it in GitHub Desktop.
Save vedovelli/c3b5152dbf8f8d6862ea to your computer and use it in GitHub Desktop.
Array Walk Example
function checkAndConvertToUpper($input)
{
$columns_to_convert = array('descricao', 'logradouro', 'complemento', 'bairro', 'cidade');
array_walk($input, function(&$item, $key, $cols)
{
if(in_array($key, $cols))
{
$item = strtoupper($item);
}
}, $columns_to_convert);
return $input;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment