Error getting tags :
error 404Error getting tags :
error 404 intersect | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
intersect
Basics
Expander triangle
Type
Command
Syntax
intersect array with templateArray
Introduced
1.1
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Removes elements from an array if they have no corresponding element in another array.
Examples

intersect myArray with the templateData of this stack

Additional Comments
Expander triangle

Use the intersect command to filter out elements from an array according to the contents of another array.

Parameters:

The array is any array variable.

The templateArray is any array variable.

Comments:

Each key of the array is checked to see whether there is a matching key in the templateArray. The elements of array that do not match an element of the templateArray are removed from the array.

The content of individual elements of the templateArray does not affect the final result. Only which elements exist in the templateArray, not their content, controls which elements of the array are retained and which are removed. If the array and templateArray have the same set of elements but different content in each element, the intersect command does not change the value of the array.

User Comments
Expander triangle