PROBLEM WITH ARRAYS!!!!
Posted: Wed Oct 08, 2008 10:51 am
Hi,
I'm having a problem with array's functions
//Making the list of the differents arrays
if($cpt_couleur+1<count($_POST["couleur"])){
$liste_tableaux_couleur.=${"tab_resultat_couleur".$cpt_couleur}.",";
}
else{
$liste_tableaux_couleur.=${"tab_resultat_couleur".$cpt_couleur};
}
//Keeping only the numbers that are present in each table
if(count($_POST["couleur"])>1){
$tab_resultat_couleur=array_merge(array_intersect($liste_tableaux_couleur));
}
else{
$tab_resultat_couleur=$liste_tableaux_couleur;
}
The problem is that array_intersect needs 2 parameters to work... I've
also tried with dynamic variables but I think I code the wrong thing 'cause it
didn't solve my problem... Is there any way to just write the content of
the variable $liste_tableaux_couleur in the function array_intersect...
something that would execute the line like :
$tab_resultat_couleur=array_merge(array_intersect($tab_resultat_couleur0,$tab_resultat_couleur1,$tab_resultat_couleur2));
...
Thanks a lot!!!!
Marie-Hélène
I'm having a problem with array's functions
//Making the list of the differents arrays
if($cpt_couleur+1<count($_POST["couleur"])){
$liste_tableaux_couleur.=${"tab_resultat_couleur".$cpt_couleur}.",";
}
else{
$liste_tableaux_couleur.=${"tab_resultat_couleur".$cpt_couleur};
}
//Keeping only the numbers that are present in each table
if(count($_POST["couleur"])>1){
$tab_resultat_couleur=array_merge(array_intersect($liste_tableaux_couleur));
}
else{
$tab_resultat_couleur=$liste_tableaux_couleur;
}
The problem is that array_intersect needs 2 parameters to work... I've
also tried with dynamic variables but I think I code the wrong thing 'cause it
didn't solve my problem... Is there any way to just write the content of
the variable $liste_tableaux_couleur in the function array_intersect...
something that would execute the line like :
$tab_resultat_couleur=array_merge(array_intersect($tab_resultat_couleur0,$tab_resultat_couleur1,$tab_resultat_couleur2));
...
Thanks a lot!!!!
Marie-Hélène