Go to: Synopsis. Return value. MEL examples.
int stringArrayCount(string $item, string[] $list)
None
Variable Name | Variable Type | Description |
---|---|---|
$item | string | The string item to search for in the string array. |
$list | string[] | A list of string values. |
string $array1[] = {"item1", "item2", "item1"}; // Result: item1 item2 item1 // int $count = stringArrayCount("item1", $array1); // Result: 2 // $count = stringArrayCount("item2", $array1); // Result: 1 // $count = stringArrayCount("plotz", $array1); // Result: 0 //