php new stdClass array 实例代码
1 $searchResults = array ();// 2 //$obj = array ("rs"=>array(),"count"=>0);//这种只能用$searchResults['rs']方式读取 3 $obj = new stdClass(); 4 $obj->rs = array(); 5 $obj->count = 0; 6 if(empty($searchResults)){ 7 $searchResults = $obj; 8 } 9 $searchResult = $searchResults->rs; 10 //object(stdClass)#14 (2) { ["rs"]=> array(10) } ["count"]=> int(48) }