[FX.php List] Help with array_unique
Bob Patin
bob at patin.com
Thu Apr 12 08:59:36 MDT 2007
Oops... I didn't copy enough of the code...
I have a field that returns with a lot of duplicate values that I
want to nuke.
Here's what I tried:
$thearray = array_unique($vlData['target_name'][0]);
After I do this, I need to feed this into a 2nd array so that I can
assign images to buttons on a page; I tried doing this:
$c=0
foreach($thearray) {
$n[$c] = $thearray[$c];
$c++;
}
Should that work?
Thanks,
BP
On Apr 12, 2007, at 9:51 AM, DC wrote:
> so, you are saying you have a related field with lots of dupes or a
> returned recordset with a lot of dupes. since those two types of
> fields are in different array positions, it is important to know.
> it is not clear from your code. also, you ask about array_unique()
> but then have no array_unique in your code.
>
> dan
>
> Bob Patin had written:
>> I've got an array that returns with a lot of duplicate values that
>> I'd like to remove; I found "array_unique" on the php.net site,
>> but I can't seem to get it formatted properly.
>> The value that I'd like to clean up is
>> $vlData['target_name'][0]
>> I tried doing this:
>> $thearray = $vlData['target_name'][0];
>> After I do this, I need to feed this into a 2nd array so that I
>> can assign images to buttons on a page; I tried doing this:
>> $c=0
>> foreach($thearray) {
>> $n[$c] = $thearray[$c];
>> $c++;
>> }
>> but that didn't work, which makes me think that I missed something...
>> Any help would be really appreciated... :)
>> Thanks,
>> bob
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
More information about the FX.php_List
mailing list