Oihana PHP Arango

bitFromString.php

Table of Contents

Functions

bitFromString()  : string
Parse a bitstring (e.g. `"0101"`) into its numeric value.

Functions

bitFromString()

Parse a bitstring (e.g. `"0101"`) into its numeric value.

bitFromString(string $bitstring) : string

Wraps the ArangoDB AQL function BIT_FROM_STRING(bitstring). It is the inverse of bitToString(). The bitstring is emitted as a quoted string literal (json_encode), so a literal such as '0101' produces valid AQL.

Example AQL usage:

BIT_FROM_STRING("0101")   // returns 5
Parameters
$bitstring : string

The bitstring to parse (emitted as a quoted string literal).

Tags
example
use function oihana\arango\db\functions\bit\bitFromString;

$expr = bitFromString('0101');   // 'BIT_FROM_STRING("0101")'
see
https://docs.arangodb.com/stable/aql/functions/bit/#bit_from_string
bitToString()
since
1.1.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results