I have a function with the data I received from json and the student name and surname. I don't have any problems when there is only one student number, but if there are two students in the incoming data, the student number comes in the array. What should I do in this case?
if($adi =="Turkce")
{
$tip = "DuzMantik";
$values = array();
foreach($olan->selections as $solan){
$og_numarasi = $solan->description;
$notum = $solan->note;
$ogrneci_adi = ogrenciadial($yil,$hafta,$og_numarasi);
$values[] = array("tur"=>$og_numarasi,"tid"=>$ogrneci_adi,"not"=>$notum);
}
$array2 = array(
"tip" => $tip,
"id" => 1,
"notlar" => $values,
);
array_push($kod, $array2);
}
ogrenciadial($yil,$hafta,$og_numarasi);
ogrenciadial(1998,5,?);