(mongodb >=1.0.0)
MongoDB\BSON\ObjectID::__toString — Returns the hexidecimal representation of this ObjectID
This function has no parameters.
Returns the hexidecimal representation of this ObjectID.
Example #1 MongoDB\BSON\ObjectID::__toString() example
<?php
var_dump((string) new MongoDB\BSON\ObjectID());
var_dump((string) new MongoDB\BSON\ObjectID('000000000000000000000001'));
?>
The above example will output something similar to:
string(24) "56731b49da14d8747d701211" string(24) "000000000000000000000001"