MongoId::__toString Returns a hexidecimal representation of this id &reftitle.description; public stringMongoId::__toString &reftitle.parameters; &no.function.parameters; &reftitle.returnvalues; This id. &reftitle.examples; <function>MongoId::__toString</function> example selectDB("foo")->selectCollection("bar"); $collection->insert(array( "x" => "y" )); $collection->insert(array( "x" => "y" )); $cursor = $collection->find(); $r1 = $cursor->next(); $r2 = $cursor->next(); echo $r1["_id"] . "\n"; echo $r2["_id"] . "\n"; ?> ]]> &example.outputs.similar;