array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'es', ), 'this' => array ( 0 => 'mongodb-bson-objectid.tostring.php', 1 => 'MongoDB\\BSON\\ObjectId::__toString', ), 'up' => array ( 0 => 'class.mongodb-bson-objectid.php', 1 => 'MongoDB\\BSON\\ObjectID', ), 'prev' => array ( 0 => 'mongodb-bson-objectid.serialize.php', 1 => 'MongoDB\\BSON\\ObjectId::serialize', ), 'next' => array ( 0 => 'mongodb-bson-objectid.unserialize.php', 1 => 'MongoDB\\BSON\\ObjectId::unserialize', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/mongodb/bson/objectid/tostring.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(mongodb >=1.0.0)
MongoDB\BSON\ObjectId::__toString — Returns the hexidecimal representation of this ObjectId
Esta función no tiene parámetros.
Returns the hexidecimal representation of this ObjectId.
Ejemplo #1 MongoDB\BSON\ObjectId::__toString() example
<?php
var_dump((string) new MongoDB\BSON\ObjectId());
var_dump((string) new MongoDB\BSON\ObjectId('000000000000000000000001'));
?>
El resultado del ejemplo sería algo similar a:
string(24) "56731b49da14d8747d701211" string(24) "000000000000000000000001"