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:
Why not just consolidate into a multi-dimensional associative array? Seems like you are going about this wrong:
$codes = array('tn','us','fr'); $names = array('Tunisia','United States','France');
becomes:
$dropdown = array('tn' => 'Tunisia', 'us' => 'United States', 'fr' => 'France');