I want to generate a selectbox using two arrays, one containing the country codes and another containing the country names.
selectbox
This is an example:
Your code like this is incorrect as foreach only for single array:
' . $name . ''; } ?>
Alternative, Change to this:
' . $names[count] . ''; $count++; } ?>