CakeFest 2024: The Official CakePHP Conference

MongoDB\BSON\Binary::__toString

(mongodb >=1.2.0)

MongoDB\BSON\Binary::__toStringReturns the Binary's data

説明

final public MongoDB\BSON\Binary::__toString(): string

このメソッドは次のメソッドのエイリアスです。 MongoDB\BSON\Binary::getData().

パラメータ

この関数にはパラメータはありません。

戻り値

Returns the Binary's data.

例1 MongoDB\BSON\Binary::__toString() example

<?php

var_dump
((string) new MongoDB\BSON\Binary('foo', MongoDB\BSON\Binary::TYPE_GENERIC));

?>

上の例の出力は以下となります。

string(3) "foo"

参考

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top