Oihana PHP Arango

ipv4FromNumber.php

Table of Contents

Functions

ipv4FromNumber()  : string
Convert a numeric IPv4 address value into its string representation.

Functions

ipv4FromNumber()

Convert a numeric IPv4 address value into its string representation.

ipv4FromNumber(string $value) : string

This helper wraps the ArangoDB AQL function IPV4_FROM_NUMBER(numericAddress) which converts a numeric IPv4 address (32-bit integer) into its dotted decimal string representation.

Example AQL usage:

IPV4_FROM_NUMBER(2130706433)  // returns "127.0.0.1"
IPV4_FROM_NUMBER(3232235521)  // returns "192.168.0.1"
IPV4_FROM_NUMBER(0)           // returns "0.0.0.0"
IPV4_FROM_NUMBER(4294967295)  // returns "255.255.255.255"
Parameters
$value : string

Numeric IPv4 address expression to convert.

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

$expr = ipv4FromNumber('doc.ipNumber');
// Produces: 'IPV4_FROM_NUMBER(doc.ipNumber)'
see
https://docs.arangodb.com/stable/aql/functions/string/#ipv4_from_number
ipv4ToNumber()

For converting string to numeric IPv4.

isIPV4()

For validating IPv4 addresses.

since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results