Bonjour,
je vous soumets mon problème :
j'ai un <form> dans lequel est inclus un tableau.
Dans ce tableau il y a, à chaque ligne, des <select>.(Le nom de lignes est variable).
Je souhaiterai réunir tous les select dans un tableau (array) en php.
Quelqu'un aurait il une idée.
Voici mes codes.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
 
<form action="" methode="">
<!-- quelque input et textarea pour le nom adresse ect -->
<table id="panier" cellspacing="0">
  <tr>
    <th scope="col">Nom photo</th>
    <th scope="col">Photos</th>
    <th scope="col">Quantité</th>
    <th scope="col">Format</th>
    <th scope="col">Surface</th>
    <th scope="col">Marges</th>
    <th scope="col">Prix unitaire</th>
    <th scope="col">Sous total</th>
    <th scope="col"></th>
  </tr>
 
  <?php foreach($_SESSION['user']['panier'] as $id=>$photo):?>
  <tr class="selection">
    <td class="gauche_tableau">Photo<br /> N° <?php echo $photo['nom'];?></td>
    <td ><img src="<?php echo DOSSIER_GALERIE;?>mini-<?php echo $id;?>.html" id="1" title="<?php echo $photo['nom'];?>" alt="<?php echo $photo['nom'];?>"/>
    </td>
 
    <td>
      <select id="quantite<?php echo $id;?>" name="quantite<?php echo $id;?>">
        <option selected="selected" value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
      </select>
    </td>
 
    <td>
      <select id="format<?php echo $id;?>" name="format<?php echo $id;?>">
            <?php foreach($selectTirage as $formatId=>$format):?>
              <?php if($format['selected']):?>                            
              <option selected="selected" value="<?php echo $formatId;?>"><?php echo $format['libelle'];?></option>
              <?php else:?>
              <option value="<?php echo $formatId;?>"><?php echo $format['libelle'];?></option>
              <?php endif;?>
            <?php endforeach;?>
            </select>
          </td>
 
          <td>
            <select id="surface" name="surface">
              <option selected="selected" value="mat">Mat</option>
              <option value="brillant">Brillant</option>
            </select>
          </td>
          <td>
            <select id="marges" name="marges">
              <option selected="selected" value="sans">Sans bords</option>
              <option value="brillant">Avec bords blancs</option>
            </select>
          </td>
          <td align="center" id="prixunitaire<?php echo $id;?>"><?php echo $prixunitaire; ?> </td>
          <td align="center" id="prixsoustotal<?php echo $id;?>"><?php echo $prixsoustotal; ?></td>
          <td><a href="commande.php5?panier=supp&photo=<?php echo $id;?>">Ne pas commander</a></td>
        </tr>
        <?php endforeach;?>
        <tr>
           <td align="right" colspan="7"><span class="commentaires">(Montant TTC)</span> <strong>Net à payer :</strong></td>
          <td  id="total"><?php echo $total;?></td>
          <td align="center"><input  name="creationpdf" type="submit" value="Créer le bon de commande"></td>
        </tr>
      </table>
</form>
Quelqu'un pourrait il m'aiguiller pour créer un array depuis mes données reçues par POST ?
l'array que je souhaiterais récupérer serait du style :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Array
(
    [nom] => Riko
    [adresse] => rue blabla 69290 PLOP
    [photo] => Array
        (
            [3] => Array
                (
                    [nom] => photo 1-3
                    [quant] => 3
                    [surface] => Mat
                    [format] => 2
                )
 
            [6] => Array
                (
                    [nom] => photo 1-6
                    [quant] => 1
                    [surface] => Mat
                    [format] => 2
                )
 
            [9] => Array
                (
                    [nom] => photo 1-9
                    [quant] => 3
                    [surface] => Mat
                    [format] => 2
                )
 
            [14] => Array
                (
                    [nom] => photo 1-14
                    [quant] => 3
                    [surface] => Mat
                    [format] => 2
                )
 
        )
)
Je souhaiterais faire ceci afin de créer un nouveau tableau dans un fichier pdf.

Merci d'avance pour vos réponses.

PS: le code html avec les ids n'est que pour faire des essais.