array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'mongodb-bson-objectid.tostring.php', 1 => 'MongoDB\\BSON\\ObjectId::__toString', 2 => 'Returns the hexidecimal representation of this ObjectId', ), 'up' => array ( 0 => 'class.mongodb-bson-objectid.php', 1 => 'MongoDB\\BSON\\ObjectId', ), 'prev' => array ( 0 => 'mongodb-bson-objectid.jsonserialize.php', 1 => 'MongoDB\\BSON\\ObjectId::jsonSerialize', ), 'next' => array ( 0 => 'class.mongodb-bson-regex.php', 1 => 'MongoDB\\BSON\\Regex', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/mongodb/bson/objectid/tostring.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

MongoDB\BSON\ObjectId::__toString

(mongodb >=1.0.0)

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

Beschreibung

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

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

Returns the hexidecimal representation of this ObjectId.

Beispiele

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

<?php

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

?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

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

Siehe auch