begins_with

Summary

Checks if an array starts with a specific element/sequence.

Usage

$input_array|begins_with( integer1 [, integer2 [, ... ] ] )

Parameters

NameTypeDescriptionRequired
interger1 integer Interger value to match first element in input array yes
interger2 integer Interger value to match second element in input array no
...

Returns

true if the parameters match the first elemnts in the input array, false if not.

Description

The begins_with operator checks if the inputted string or array begins with a specified element/character/sequence (or not). Returns true or false.

Examples

{array( 1, 2, 3, 4, 5, 6, 7 )|begins_with( 1, 2, 3 )}

returns true.

{array( 1, 2, 3, 4, 5, 6, 7 )|begins_with( 2, 3, 4 )}

returns false.

Comments

log in or create a user account to comment.

Contents

Reference

Database diagram
Template operators
    PDF
    Arrays
       array_sum
       append
       array
       array_append
       array_merge
       array_prepend
       begins_with
       compare
       contains
       ends_with
       explode
       extract
       extract_left
       extract_right
       hash
       implode
       insert
       merge
       prepend
       remove
       repeat
       reverse
       array_sum
       unique
    Data extraction
    Formatting
    Images
    Logic
    Mathematics
    Miscellaneous
    Strings
    URLs
    Variables
Template functions
Data fetching
Modules
XML tags


Created

05/02/2004
10:29:47 am
by Balazs Halasy

Last updated

05/02/2004
7:12:51 pm
by Balazs Halasy

Authors

Balazs Halasy
Kåre Køhler Høvik



This page is part of the Exponential documentation. The documentation is available under the GNU Free Documentation License. All contributions will be released under the terms of this license.