如何獲取數組數據到foreach循環在PHP如何讓PHP
時遇到的代碼如下
$years = $this->report_model->get_year();
print_r($years);
時上午印刷正在逐漸爲
數組數據到foreach循環Array ([0] => stdClass Object ([financial_year] => 1972-1973) [1] => stdClass Object ([financial_year] => 1973-1974) [2] => stdClass Object ([financial_year] => 1974-1975) [3] => stdClass Object ([financial_year] => 1975-1976) [4] => stdClass Object ([financial_year] => 1976-1977) [5] => stdClass Object ([financial_year] => 1977-1978) [6] => stdClass Object ([financial_year] => 1978-1979)
,當我在foreach循環是給作爲
foreach ($years as $year) {
$data['result_data'][] = $this->report_model->get_historical_data($year);
}
我得到的php誤差
A PHP Error was encountered
Severity: 4096
Message: Object of class stdClass could not be converted to string
Filename: database/DB_active_rec.php
Line Number: 42
究竟是什麼錯誤我在這裏做
您正在使用某種形式的框架或第三方庫?數據訪問如何配置? – GordonM