php8.5
Home/ Manual/ bson / regex/ MongoDB\BSON\Regex::getFlags

MongoDB\BSON\Regex::getFlags

PHP function Edit on GitHub ✎

(mongodb >=1.0.0)

Returns the Regex's flags

Description

MongoDB\BSON\Regex::getFlags(): string

Parameters Parameters

Return Values

Returns the Regex's flags.

Errors/Exceptions

Examples

MongoDB\BSON\Regex::getFlags() example

php
<?php

$regex = new MongoDB\BSON\Regex('regex', 'i');
var_dump($regex->getFlags());

?>

The above example will output something similar to:

output
string(1) "i"

See Also

  • BSON Types
  • Supported regular expression flags

Source: reference/mongodb/bson/regex/getflags.xml · from the official PHP manual (php/doc-en)