(PECL mongo >=1.3.0)
MongoClient::__get — 取锟斤拷一锟斤拷锟斤拷锟捷匡拷
This extension that defines this method is deprecated. Instead, the MongoDB extension should be used. There is no equivalent for this method in the new extension, but there is an alternative in the PHP library:
锟斤拷锟角伙拷取一锟斤拷锟斤拷锟捷匡拷锟斤拷锟斤拷姆锟斤拷锟斤拷锟� 锟斤拷锟斤拷锟斤拷菘锟斤拷锟斤拷瓢锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷址锟斤拷锟斤拷锟揭癸拷锟� MongoClient::selectDB() 锟斤拷锟斤拷锟斤拷锟斤拷锟角达拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷涂锟斤拷浴锟�
<?php
$mongo = new MongoClient();
// 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷一锟斤拷锟斤拷
$db = $mongo->selectDB("foo");
$db = $mongo->foo;
?>
dbname
锟斤拷锟捷匡拷锟斤拷
锟斤拷锟斤拷一锟斤拷锟铰碉拷 db 锟斤拷锟斤拷
锟斤拷锟斤拷锟斤拷菘锟斤拷锟斤拷锟叫э拷锟斤拷锟斤拷锟斤拷壮锟斤拷斐o拷锟�