直接從CodeIgniter page拍攝。PHP中的分隔(|)?
$this->form_validation->set_rules('username', 'Username', 'trim|required|min_length[5]|max_length[12]|xss_clean');
這一部分:
'trim|required|min_length[5]|max_length[12]|xss_clean'
PHP是否有一個內置的功能,通過獨立值|檢查,或CodeIgniter手動?
如果是這樣,
他們爲什麼不使用類似的東西?
set_rules('username', 'Username', array('trim', 'required' ...));
是不是容易得多處理數組,而不是浪費不必要的代碼檢查|符號和獨立標籤?
請給出一個實際上導致文本「_directly從CodeIgniter page_」的鏈接。這可能會給其他人一些見解。 – Tadeck
「處理數組不是很容易,而不是浪費不必要的代碼來檢查符號和分離標記嗎?」 --- codeigniter不是你想要學習的一款軟件。所以不要懷疑你的代碼中是否有奇怪的東西;-) – zerkms
嗨,在這裏:http://codeigniter.com/user_guide/libraries/form_validation.html – Aristona