downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

MongoCode> <MongoId::__set_state
[edit] Last updated: Fri, 25 May 2012

view this page in

MongoId::__toString

(PECL mongo >= 0.8.0)

MongoId::__toStringRetourne une représentation hexadécimale de cet identifiant

Description

public string MongoId::__toString ( void )

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Cet identifiant.

Exemples

Exemple #1 Exemple avec MongoId::__toString()

<?php

$m 
= new Mongo();
$collection $m->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";

?>

L'exemple ci-dessus va afficher quelque chose de similaire à :

49a7011a05c677b9a916612a
49a702d5450046d3d515d10d


add a note add a note User Contributed Notes MongoId::__toString
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites