Jump to content

[SOLVED] array_unique()


Recommended Posts

Hi, I'm trying to use the array_unique function and its not giving me some of my values...

 

So for example,

 

$input = array("4", "4", "3", "4", "3", "5","7","7");

$indiGroup = array_unique($input);

 

for($j=0; $j < count($indiGroup); $j++) {

      print "<option value=$indiGroup[$j]>$indiGroup[$j]</option>";

}

 

When I put this code in my page, my drop down lists has "4", and then a gap, and then "3", and then a gap.. It seems to be missing every second one.

 

???

 

Link to comment
https://forums.phpfreaks.com/topic/50317-solved-array_unique/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.