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) } 

 

相关文章:

  • 2021-09-27
  • 2022-12-23
  • 2022-01-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-14
  • 2021-12-16
猜你喜欢
  • 2021-12-30
  • 2022-12-23
  • 2022-12-23
  • 2021-07-13
  • 2021-08-17
相关资源
相似解决方案