array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'function.mongodb.bson-fromphp.php', 1 => 'MongoDB\\BSON\\fromPHP', 2 => 'Returns the BSON representation of a PHP value', ), 'up' => array ( 0 => 'ref.bson.functions.php', 1 => 'İşlevleri', ), 'prev' => array ( 0 => 'function.mongodb.bson-fromjson.php', 1 => 'MongoDB\\BSON\\fromJSON', ), 'next' => array ( 0 => 'function.mongodb.bson-tocanonicalextendedjson.php', 1 => 'MongoDB\\BSON\\toCanonicalExtendedJSON', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/mongodb/functions/bson/fromphp.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(mongodb >=1.0.0)
MongoDB\BSON\fromPHP — Returns the BSON representation of a PHP value
This function has been DEPRECATED as of extension version 1.20.0 and was removed in 2.0. Applications should use MongoDB\BSON\Document::fromPHP() instead.
Serializes a PHP array or object (e.g. document) to its » BSON representation. The returned binary string will describe a BSON document.
The serialized BSON document as a binary string.
| Sürüm: | Açıklama |
|---|---|
| PECL mongodb 2.0.0 | This function was removed. |
Örnek 1 MongoDB\BSON\fromPHP() example
<?php
$bson = MongoDB\BSON\fromPHP(['foo' => 1]);
echo bin2hex($bson), "\n";
?>Yukarıdaki örneğin çıktısı:
0e00000010666f6f000100000000cat