how to trim input?

#1
[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?

#2
[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

#3
[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. =)

#4
[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?

#5
[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)... =)


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.