remove duplicate array php -


i have script this

foreach ($onerow $onekey => $dt ){ $arr = array(); foreach($row $classkey => $classfoto):   $cek_class_foto = explode("/",$classfoto->name);   if($dt->foto_naam!=$cek_class_foto[1]){      $arr = array($dt->foto_naam);     print_r(array_unique($arr));   } endforeach; } 

the output this

array ( [0] => _b101203.jpg )  array ( [0] => _b101203.jpg ) 

my question is, how remove duplicates array?

thank you

you overwriting $arr each iteration.

foreach ($onerow $onekey => $dt ){     $arr = array();     foreach($row $classkey => $classfoto):         $cek_class_foto = explode("/",$classfoto->name);         if($dt->foto_naam!=$cek_class_foto[1]){              $arr[] =$dt->foto_naam;         }     endforeach; } $arr = array_unique($arr); 

Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -