begins_with
Summary
Checks if an array starts with a specific element/sequence.Usage
input|begins_with( element1 [, element2 [, ... ] ] )
Parameters
Name | Type | Description | Required |
---|---|---|---|
element1 | any | An element that should be matched. | Yes. |
element2 | any | Another element that should be matched. | No. |
Returns
TRUE or FALSE.Description
This operator checks if the input array starts with a specified sequence of elements. If yes, the operator returns TRUE, otherwise FALSE will be returned.
Examples
Example 1
{array( 1, 2, 3, 4, 5, 6, 7 )|begins_with( 1, 2, 3 )}
Returns TRUE.
Example 2
{array( 1, 2, 3, 4, 5, 6, 7 )|begins_with( 2, 3, 4 )}
Returns FALSE.
Balazs Halasy (05/02/2004 9:29 am)
Balazs Halasy (04/05/2005 1:27 pm)
Comments
There are no comments.