php count计算stdClass Object长度

PHP 要使用 count() 來計算 stdClass Object 數量, 計算出來的數字會有問題, 需要強制轉換成陣列來作計算.

註: 強制轉換方法: (array)$obj_var; 於是就可以 count((array)$obj_var);

posted on 2014-07-27 14:17  lchecho  阅读(1373)  评论(0编辑  收藏  举报

导航