ColdFusion UDF Library - arrayValueCount
December 16th, 2008
«« Back to ColdFusion Library
Category:
ARRAY
Description:
Counts the number of times a value is found within an array.
Parameters:
Returns:
Requires:
Sample Use:
Copy to Clipboard
Category:
ARRAY
Description:
Counts the number of times a value is found within an array.
Parameters:
- array (Array, required)
The array you wish to count matches in. - value (String, required)
The string you want to search for in the array.
Returns:
Requires:
Sample Use:
Copy to Clipboard
function arrayValueCount(array,value){
var count = 0;
var loop = 0;
for (loop = 1; loop lte arrayLen(array); loop = incrementValue(loop)){
if (array[loop] eq value)count = incrementValue(count);
};
return count;
};
// http://www.programmers.org/index.php/coldfusion-udf-library/?ckey=84&function=arrayValueCount



