Bonjour,
Je n'ai pas bien compris ton problème, mais tu veux arriver à ce résultat ? (avec les ID en plus, mais elles seront ajoutées automatiquement)
array (size=6)
0 =>
array (size=4)
'sequences_id' => string '1' (length=1)
'filieres_id' => string '18' (length=2)
'matieres_id' => string 'Informatique' (length=12)
'noteobtenu' => string '7844' (length=4)
1 =>
array (size=4)
'sequences_id' => string '1' (length=1)
'filieres_id' => string '18' (length=2)
'matieres_id' => string 'Informatique' (length=12)
'noteobtenu' => string '4541' (length=4)
2 =>
array (size=4)
'sequences_id' => string '1' (length=1)
'filieres_id' => string '18' (length=2)
'matieres_id' => string 'Informatique' (length=12)
'noteobtenu' => string '5211' (length=4)
3 =>
array (size=4)
'sequences_id' => string '1' (length=1)
'filieres_id' => string '18' (length=2)
'matieres_id' => string 'Informatique' (length=12)
'noteobtenu' => string '2311' (length=4)
4 =>
array (size=4)
'sequences_id' => string '1' (length=1)
'filieres_id' => string '18' (length=2)
'matieres_id' => string 'Informatique' (length=12)
'noteobtenu' => string '21122' (length=5)
5 =>
array (size=4)
'sequences_id' => string '1' (length=1)
'filieres_id' => string '18' (length=2)
'matieres_id' => string 'Informatique' (length=12)
'noteobtenu' => string '565' (length=3)
Si oui, voilà le code qui le permet :
<?php
$data = [
'Note' => [
'sequences_id' => '1',
'filieres_id' => '18',
'matieres_id' => 'Informatique'
],
'noteobtenu0' => '7844',
'noteobtenu1' => '4541',
'noteobtenu2' => '5211',
'noteobtenu3' => '2311',
'noteobtenu4' => '21122',
'noteobtenu5' => '565'
];
$results = [];
foreach($data as $key => $note){
if($key != 'Note'){
$data['Note']['noteobtenu'] = $note;
$results[] = $data['Note'];
}
}
// var_dump($results);
En espérant avoir résolu ton problème,
Arkantos.