MongoDB\BSON\Regex::__toString
PHP function
Edit on GitHub ✎
(mongodb >=1.0.0)
Returns the string representation of this Regex
Description
MongoDB\BSON\Regex::__toString(): string
Parameters Parameters
Return Values
Returns the string representation of this Regex.
Examples
MongoDB\BSON\Regex::__toString() example
php
<?php
$regex = new MongoDB\BSON\Regex('regex', 'i');
var_dump((string) $regex);
?>The above example will output:
output
string(8) "/regex/i"See Also
- BSON Types