Two arrays in foreach loop

后端 未结 22 1917
不思量自难忘°
不思量自难忘° 2020-11-22 04:48

I want to generate a selectbox using two arrays, one containing the country codes and another containing the country names.

This is an example:

22条回答
  •  天命终不由人
    2020-11-22 05:43

    I solved a problem like yours by this way:

    foreach(array_keys($idarr) as $i) {
     echo "Student ID: ".$idarr[$i]."
    "; echo "Present: ".$presentarr[$i]."
    "; echo "Reason: ".$reasonarr[$i]."
    "; echo "Mark: ".$markarr[$i]."
    "; }

提交回复
热议问题