(mongodb >=1.0.0)
MongoDB\BSON\ObjectId::__toString — Returns the hexidecimal representation of this ObjectId
此函數(shù)沒有參數(shù)。
Returns the hexidecimal representation of this ObjectId.
示例 #1 MongoDB\BSON\ObjectId::__toString() example
<?php
var_dump((string) new MongoDB\BSON\ObjectId());
var_dump((string) new MongoDB\BSON\ObjectId('000000000000000000000001'));
?>
以上例程的輸出類似于:
string(24) "56731b49da14d8747d701211" string(24) "000000000000000000000001"