Re: Functions
| From: | Chris | Date: | Fri, 30 Jun 2006 05:18:41 +0000 |
| Subject: | Re: Functions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-238955@lists.php.net to get a copy of this message | ||
benc11@gmail.com wrote:
I am trying to create a function to clean up variables that are user inputted from a form. I am not getting this script to work. Can anyone help. ---Start Script--- function cleaner($var) { trim(strip_tags(ucfirst(addslashes($var)))); } $var = "abc's"; echo $var;You need to return the value from the function: return trim(strip_tags(.....) or pass in a reference: function cleaner (&$var) -- Postgresql & php tutorials http://www.designmagick.com/