php8.5
Home/ Manual/ bson / binary/ MongoDB\BSON\Binary::getData

MongoDB\BSON\Binary::getData

PHP function Edit on GitHub ✎

(mongodb >=1.0.0)

Returns the Binary's data

Description

MongoDB\BSON\Binary::getData(): string

Parameters Parameters

Return Values

Returns the Binary's data.

Errors/Exceptions

Examples

MongoDB\BSON\Binary::getData() example

php
<?php

$binary = new MongoDB\BSON\Binary('foo', MongoDB\BSON\Binary::TYPE_GENERIC);
var_dump($binary->getData());

?>

The above example will output:

output
string(3) "foo"

See Also

  • BSON Types

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