Please wait while we load your page...
 

Announcements

PHP Manual :: MongoDB\BSON\Binary::__construct



MongoDB\BSON\Binary || MongoDB\BSON\Binary::getData || PHP Manual

(mongodb >=1.0.0)

MongoDB\BSON\Binary::__constructConstruct a new Binary

Description

final public MongoDB\BSON\Binary::__construct ( string $data , integer $type )

Parameters

data (string)

Binary data.

type (integer)

Binary type.

Errors/Exceptions

Examples

Example #1 MongoDB\BSON\Binary::__construct() example

<?php

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

?>

The above example will output:

object(MongoDB\BSON\Binary)#1 (2) {
  ["data"]=>
  string(3) "foo"
  ["type"]=>
  int(0)
}

See Also



MongoDB\BSON\Binary || MongoDB\BSON\Binary::getData || PHP Manual
Live Chat Not Available