It happens that I have a select where the options are generated from a query to a database. Sometimes there are repeated options because at the beginning or at the end of each option you have blank spaces. I have the following code where I try to apply the function trim () to an array but it generates the following error: ** Warning: trim () expects parameter 1 to be string, array given in C ** I was trying to do it this way :
if (isset($sistemas)) {
trim($sistemas);
$sistemas2 = array_unique($sistemas);
}