svn: /phpdoc/en/trunk/reference/mongo/mongodb/ getcollectionnames.xml

From: Date: Thu, 11 Sep 2014 11:53:57 +0000
Subject: svn: /phpdoc/en/trunk/reference/mongo/mongodb/ getcollectionnames.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-12799@lists.php.net to get a copy of this message
derick Thu, 11 Sep 2014 11:53:57 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=334841 Log: Integrate note for nicer formatting. Changed paths: U phpdoc/en/trunk/reference/mongo/mongodb/getcollectionnames.xml Modified: phpdoc/en/trunk/reference/mongo/mongodb/getcollectionnames.xml =================================================================== --- phpdoc/en/trunk/reference/mongo/mongodb/getcollectionnames.xml 2014-09-11 11:50:19 UTC (rev 334840) +++ phpdoc/en/trunk/reference/mongo/mongodb/getcollectionnames.xml 2014-09-11 11:53:57 UTC (rev 334841) @@ -47,22 +47,23 @@ <programlisting role="php"> <![CDATA[ <?php +$m = new MongoClient; +$collections = $m->selectDB("demo")->getCollectionNames(); -$m = new Mongo; -$collections = $m->selectDB("demo")->getCollectionNames(); -var_dump($collections); +foreach ($collections as $collectionName) { + echo "Found collection: ", $collectionName, "\n"; +} ?> ]]> </programlisting> &example.outputs.similar; <screen> <![CDATA[ -array(2) { - [0]=> - string(9) "addresses" - [1]=> - string(5) "users" -} +... +Found collection: img +Found collection: beer +Found collection: collation +... ]]> </screen> </example>

« previous php.doc.cvs (#12799) next »