MongoDB\BSON\ObjectId::__toString

(mongodb >=1.0.0)

MongoDB\BSON\ObjectId::__toStringReturns the hexidecimal representation of this ObjectId

Descrierea

final public MongoDB\BSON\ObjectId::__toString ( void ) : string

Parametri

Această funcție nu are parametri.

Valorile întoarse

Returns the hexidecimal representation of this ObjectId.

Exemple

Example #1 MongoDB\BSON\ObjectId::__toString() example

<?php

var_dump
((string) new MongoDB\BSON\ObjectId());
var_dump((string) new MongoDB\BSON\ObjectId('000000000000000000000001'));

?>

Exemplul de mai sus va afișa ceva similar cu:

string(24) "56731b49da14d8747d701211"
string(24) "000000000000000000000001"