MongoDB\BSON\Binary::__toString
PHP function
Edit on GitHub ✎
(mongodb >=1.2.0)
Returns the Binary's data
Description
MongoDB\BSON\Binary::__toString(): string
Alias MongoDB\BSON\Binary::getData.
Parameters Parameters
Return Values
Returns the Binary's data.
Examples
MongoDB\BSON\Binary::__toString() example
php
<?php
var_dump((string) new MongoDB\BSON\Binary('foo', MongoDB\BSON\Binary::TYPE_GENERIC));
?>The above example will output:
output
string(3) "foo"See Also
MongoDB\BSON\Binary::getData- BSON Types