[FX.php List] Summary of Records
william.downs
william.downs at gmail.com
Mon Dec 8 11:20:13 MST 2008
Hi Andy,
- very helpful indeed,
many thanks
William
On 8 Dec 2008, at 18:16, Andy Gaunt wrote:
William,
From your array you can use a foreach loop to build your select items.
$selectMenu = "<select name='selectField' id='selectField'>\n";
foreach ($uniqueList as $value) {
$selectMenu .= "<option value='$value'>$value</option>\n";
}
$selectMenu .= "</select>";
echo $selectMenu;
HTH
Andy Gaunt
T: 321-206-3658
andy at fmpug.com
http://www.fmpug.com
FMPug.com: A Developer's best Friend!
FindFileMakerDevelopers.com -
The #1 listings engine for FileMaker Professionals
On Dec 8, 2008, at 1:10 PM, william.downs wrote:
> Hi Anders (and Co)
>
> i like the array_unique() - just what I needed.
>
> Now I need to turn $uniqueList into a select (html drop down)
>
> Any idea how that could be done ?
>
> Kindest Regards
>
> William
>
> On 8 Dec 2008, at 15:41, Anders Monsen wrote:
>
> How about array_unique?
>
> $theList = array('Team1','Team1','Team2','Team3','Team1','Team2' );
> $uniqueList = array_unique($theList);
> sort($uniqueLists);
>
> Anders
>
> On Dec 8, 2008, at 9:35 AM, Steve Winter wrote:
>
>> Hi William,
>>
>> You could go with something like this;
>>
>> $uniqueList = array()
>>
>> foreach($teamList as $team) {
>> if(!in_array($team, $uniqueList) {
>> $uniqueList[] = $team;
>> }
>> }
>>
>> Then $uniqueArray will have only one entry for each $team. You may
>> also then want to do a sort on that array prior to output in case
>> the data that it received was
>>
>> Team3
>> Team1
>> Team3
>> Team2
>>
>> Cheers
>> Steve
>>
>>
>>
>>
>> On 8 Dec 2008, at 15:05, william.downs wrote:
>>
>>>
>>> Hi there List,
>>>
>>> If an array was to return more than one record, and a value was
>>> repeated, how do I strip out the individual values ?
>>>
>>> Example :
>>>
>>> If the returned values were
>>>
>>> Team1
>>> Team2
>>> Team1
>>> Team3
>>> Team1
>>>
>>> I would ONLY want to see
>>> Team1
>>> Team2
>>> Team3
>>>
>>> In Filemaker, I could create a value list, or a sub-summary list,
>>> and this would give me the individual records.
>>>
>>>
>>> Kindest Regards
>>>
>>> William
>>> _______________________________________________
>>> 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
>>
>>
>
> _______________________________________________
> 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
_______________________________________________
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