Oihana PHP Arango

encodeURIComponent.php

Table of Contents

Functions

encodeURIComponent()  : string
Return the URI component-encoded string of a value.

Functions

encodeURIComponent()

Return the URI component-encoded string of a value.

encodeURIComponent(string $value) : string

This helper wraps the ArangoDB AQL function ENCODE_URI_COMPONENT(value) which returns the URI component-encoded version of the input string. This is useful for encoding special characters in URL components.

Example AQL usage:

ENCODE_URI_COMPONENT("hello world")       // returns "hello%20world"
ENCODE_URI_COMPONENT("a+b=c")             // returns "a%2Bb%3Dc"
ENCODE_URI_COMPONENT(doc.name)            // returns encoded name
Parameters
$value : string

String expression to encode.

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

$expr = encodeURIComponent('doc.name');
// Produces: 'ENCODE_URI_COMPONENT(doc.name)'
see
https://docs.arangodb.com/stable/aql/functions/string/#encode_uri_component
since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results