我想在我的codeigniter控制器中添加一個ucfirst()函數,所以我會找回第一個大寫字母的字符串。在...第7行(在我的ucfirst是行)在php 5.3中使用ucfirst()函數返回一個解析錯誤
;語法錯誤,意外「(」,希望「」或‘’:出於某種原因,我不斷收到一個解析錯誤:解析錯誤。
試圖改變ucfirst()來ucfirst(用strtolower($數據庫))或ucwords($數據庫)返回相同的結果
我的代碼是:
defined('BASEPATH') OR exit('No direct script access allowed');
class Somecontroller extends CI_Controller {
private $database = "some_database";
private $model = ucfirst($this->database)."_model";
...
}
謝謝!如你所說,問題已解決。 – 2013-03-14 18:14:25