PHP - 从对象获取数组

时间:2012-12-01 23:25:43

标签: php odbc

在PHP中,我有来自MSSQL数据库的结果:

CI_DB_odbc_result Object ( [num_rows] => 5 [conn_id] => Resource id #34 [result_id] => Resource id #49 [result_array] => Array ( [0] => Array ( [NO1] => 119 [NO2] => 115 [NO3] => 123 [NO4] => 127)

您能否告诉我如何访问/提取[result_array] =>数组([0] =>数组([NO1] => 119 [NO2] => 115 [NO3] => 123 [NO4] => 127)进入普通PHP数组?

1 个答案:

答案 0 :(得分:1)

对象属性可以访问该数组。

$result = CI_DB_odbc_result->result_array;
print_r($result);