Hi :)
I got a problem with 2 foreach. When i execute it the result repeats X times.
This is my code:
$tab1=array('name','firstname','age');
$exceptions=array('hide','submitForm');
$test='';
foreach($tab1 as $val){
$test.=$val.'=';
foreach($_POST as $key=>$value){
if(!in_array($key,$exceptions)){
$test.=$value.',';
}
}
}
echo $test;
This is the result obtained:
name=Smith,John,30,firstname=Smith,John,30,age=Smith,John,30,
I would like to obtain this:
nom_test=Smith,prenom_test=John,age_test=30
Thanks for your help :)