[FX.php List] Help with array_unique

Bob Patin bob at patin.com
Thu Apr 12 09:08:31 MDT 2007


Dan,

here's what I just tried, but I'm still getting a parser error:

$c=0;
$thearray = array('c');
$thearray = array_unique($vlData['target_name'][0]);
$n = array('thename');
$i = array('image');
foreach($thearray) {
	$n[$c] = $thearray[$c];
	$c++;
}

Shouldn't that work?

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