Bonjour à tous,

J'ai un tableau php à partir duquel je souhaite créer un tableau multimentionnel en js et j'ai le message "missing before argument"

Le code :
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
echo "var options = New Array();\n";
                        foreach($pack as $packs){
                            $i=0;
                            $compteur=0;
 
                            $compteur=count($options[$packs->nom_general]);
                            if ($compteur!=0){
                                $tableauJS.="var options[".$packs->nom_general."] = New Array();\n";
                                for ($i==0;$i<$compteur;$i++){
                                    $tableauJS.="options[".$packs->nom_general."][".$options[$packs->nom_general][$i]->id."]='".$options[$packs->nom_general][$i]->nom."';\n";
                                }
                            }
                            $i++;
                         }";
                         }
et ce que j'ai en resultat dans le source :
Code javascript : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
						 <script>
                 var options = New Array();
var options[type] = New Array();
options[type][3]='123';
options[type][4]='456';
options[type][22]='789';
var options[arome] = New Array();
options[arome][246]='abc';
var options[couleur] = New Array();
options[couleur][149]='poi';
 
                    </script>