Oihana PHP Arango

isBindVariable.php

Table of Contents

Functions

isBindVariable()  : bool
Checks if the given string is a valid ArangoDB bind variable name.

Functions

isBindVariable()

Checks if the given string is a valid ArangoDB bind variable name.

isBindVariable(string $bindParameter) : bool

ArangoDB bind variables:

  • May optionally start with '@'
  • Must start with a letter (a-zA-Z) or underscore '_'
  • Subsequent characters can be letters, digits, or underscores

Valid examples:

  • @userId
  • foo
  • _bar123

Invalid examples:

  • 123abc (starts with a digit)
  • @!invalid (invalid character '!')
  • user-id (hyphen not allowed)
Parameters
$bindParameter : string

The string to check

Tags
example
isBindVariable('@userId') ;   // true
isBindVariable('foo') ;       // true
isBindVariable('123abc') ;    // false
isBindVariable('@!invalid') ; // false
since
1.0.0
author

Marc Alcaraz

Return values
bool

True if the string is a valid bind variable name, false otherwise

On this page

Search results