Oihana PHP Arango

left.php

Table of Contents

Functions

left()  : string
Return the leftmost characters of a string.

Functions

left()

Return the leftmost characters of a string.

left(string $value, int $length) : string

This helper wraps the ArangoDB AQL function LEFT(value, length) which returns the specified number of characters from the left (beginning) of the string.

Example AQL usage:

LEFT("hello world", 5)        // returns "hello"
LEFT("hello world", 0)        // returns ""
LEFT("hello world", 20)       // returns "hello world" (entire string)
LEFT(doc.title, 10)           // returns first 10 characters of title
Parameters
$value : string

String expression to extract characters from.

$length : int

Number of characters to return from the left.

Tags
example
use function oihana\arango\db\functions\strings\left;

$expr = left('doc.title', 10);
// Produces: 'LEFT(doc.title, 10)'
see
https://docs.arangodb.com/stable/aql/functions/string/#left
right()

For extracting characters from the right.

subString()

For extracting characters from any position.

since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results