I have two arrays which contain the same number of values each. One contains the id
of materia
and the other calificaciones
.
I need to access the qualifications to later enter them into a database. The problem is that I can access the subjects with a cycle for
. But how can I access the ratings within the same cycle?
This is my code, try another cycle for
inside but do not do what I want.
<?php
//require('../../../php/cone.php');
$id = $_POST['id'];
$matricula = $_POST['matricula'];
$periodo = $_POST['periodo'];
$calificacion = $_POST['calificacion']; //Esto es un array
$materia = $_POST['materia']; //Esto es un array
//Recorro todos los elementos que hay en materia
for ($i=0;$i<count($materia);$i++)
{
//saco el valor de cada elemento
echo "Materia: ".$materia[$i]."";
//Aqui necesito acceder al array que esta en la variable materia.
//Intente con otro ciclo for dentro pero no hace lo que deseo.
echo "Calificacion: ".$calificacion."";
echo "<br>";
}
?>