split.php
Table of Contents
Functions
- split() : string
- Split a string into an array using a separator.
Functions
split()
Split a string into an array using a separator.
split(string $value, string $separator[, int|null $limit = null ]) : string
This helper wraps the ArangoDB AQL function SPLIT(value, separator, limit)
which splits the given string into an array of strings using the specified
separator. You can optionally limit the number of splits.
Example AQL usage:
SPLIT("a,b,c", ",") // returns ["a", "b", "c"]
SPLIT("hello world", " ") // returns ["hello", "world"]
SPLIT("a,b,c", ",", 2) // returns ["a", "b,c"] (limited to 2 parts)
SPLIT("hello", "") // returns ["h", "e", "l", "l", "o"] (split by character)
Parameters
- $value : string
-
String expression to split.
- $separator : string
-
Separator string to split on.
- $limit : int|null = null
-
Optional limit for number of splits.
Tags
Return values
string —The formatted AQL expression.