how to trim input? |
[eluser]nuclearmaker[/eluser]
i dont want to use form_validation for trim input. so i must use native trim function or ci have a slution for that?
[eluser]umefarooq[/eluser]
hi its really easy just add trim in rules it will call this function here is example Code: $this->form_validation->set_rules('username', 'Username', 'trim|required|min_length[5]|max_length[12]|xss_clean'); read documentation http://ellislab.com/codeigniter/user-gui...ation.html
[eluser]Gerep[/eluser]
umefarooq, nuclearmaker doesn't want to use form_validation. Code: trim($text); You haven't searched for on Google right? A simple "trim php" solved the problem. =)
[eluser]cideveloper[/eluser]
[quote author="Gerep" date="1296578728"]umefarooq, nuclearmaker doesn't want to use form_validation. Code: trim($text); You haven't searched for on Google right? A simple "trim php" solved the problem. =)[/quote] Gerep, nuclearmaker already knows about the native trim function. He was asking if CI has a solution for this. Quote:so i must use native trim function or ci have a slution for that?
[eluser]Gerep[/eluser]
cideveloper I got that....but it would be totally unnecessary to create a function like $this->string->trim($text) if you can simply use trim($text)... =) |
Welcome Guest, Not a member yet? Register Sign In |