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', ), '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', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(mongodb >=1.0.0)
MongoDB\BSON\fromPHP — Returns the BSON representation of a PHP value
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.
Örnek 1 MongoDB\BSON\fromPHP() example
<?php
$bson = MongoDB\BSON\fromPHP(['foo' => 1]);
echo bin2hex($bson), "\n";
?>
Yukarıdaki örneğin çıktısı:
0e00000010666f6f000100000000cat