I'm trying to create the arguments of array_multisort using some variables that are not standard. Here's my code:
$qs = '';
foreach ($fields as $fld) {
$qs .= ${"field".$fld}.', SORT_DESC, ';
}
$qs .= '$arr';
array_multisort($qs);
//array_multisort($field108, SORT_ASC, SORT_STRING, $field109, SORT_ASC, SORT_STRING, $field110, SORT_ASC, SORT_STRING, $field112, SORT_ASC, SORT_STRING, $arr);
After the foreach() there will be 4 variable names (previously generated arrays), $field108, $field109, $field110, $field112. If i use the commented line, with the variables hard coded, it will work, but i can't find the solution to transfer the arquments inside that array_multisort with $qs.