Description
Searches an array for all positions of a specified object. The function searches for simple objects such as strings and numbers or for complex objects such as structures. When the second parameter is a simple object, string searches are case-sensitive. This function does not support searches for COM and CORBA objects.
Returns
Array of indices in which the object was found.
Category
Closure functions
Syntax
ArrayFindAll(array, object) |
See also
Other closure functions.
History
ColdFusion 10: Added this function.
Parameters
Parameter |
Description |
---|---|
array |
Array to search in. |
object | Object to search for. |
function |
Inline function executed for each element in the array. Returns true if the array elements match the search criterion. |
arrayElement |
Array element being accessed. |
Example
<cfscript> writeDump(ArrayFindAll(["STRING","string"], "string")); writeDump(ArrayFindAll(["STRING","string"], function(s) {if(compare(s, "string")==0) return true; return false;})); </cfscript> |