I needed to create dynamic variables and I used this script:
for($i=1;$i<=40;$i++){
${"horario" . $i} = get_custom_field('horario'.$i);
}
It generates the variables $ schedule1, $ schedule2, ...
Now I need to group all these variables into an array. How do I do this?