This is the following, I am creating a function that receives an array and transforms the writing into uppercase, the code is as follows:
function uppercase($post_array) //ok
{
$post_array['clienteNomeCompleto'] = mb_strtoupper($post_array['clienteNomeCompleto']);
return $post_array;
}
Well that's the problem, in this example, I know the value is in the fieldCompleteName field, but the other fields I do not know the name, because the same function will receive data from 3 different lists, one from clients, another of suppliers, and another one of employees, each with specific fields, hence I wanted to know, how do I do this without having to specify the field name? I tried it like this:
function uppercase($post_array)
{
$post_array = mb_strtoupper($post_array);
return $post_array;
}
And so:
function uppercase($post_array) //ok
{
$count = count($post_array)
for( $i=0; i<=$count; $i++){
mb_strtoupper($post_array[$i]);
}
return $post_array;
}
Even with a foreach I tried:
function uppercase($post_array) //ok
{
foreach ($post_array as $value){
$value = mb_strtoupper($value);
}
return $value;
}
Can anyone give me a light, what am I doing wrong? And if it is not uncomfortable, as I do the same function, except that to remove the characters,.;: | \ | -_ () [] {} too.