contains.php
Table of Contents
Functions
- contains() : string
- Check whether a string contains a substring (case-sensitive).
Functions
contains()
Check whether a string contains a substring (case-sensitive).
contains(string $text, string $search[, bool $returnIndex = false ]) : string
This helper wraps the ArangoDB AQL function CONTAINS(text, search, returnIndex)
which checks if the search string is contained within the text string.
The matching is case-sensitive by default.
Example AQL usage:
CONTAINS("Hello World", "World") // returns true
CONTAINS("Hello World", "world") // returns false (case-sensitive)
CONTAINS("Hello World", "World", true) // returns 6 (position)
Parameters
- $text : string
-
The text to search in.
- $search : string
-
The substring to search for.
- $returnIndex : bool = false
-
When true, returns the position; when false, returns boolean.
Tags
Return values
string —The formatted AQL expression.