Posted by JackM on 10/31/05 02:16
I'm trying to write a function that will trim and strip new line character returns from submitted $_POST values. Does this look serviceable? function trim_data($formdata) { foreach ($formdata as $key => $value) { $value = preg_replace("(\r\n|\n|\r|\t)", "", $value); $newdata[trim($key)] = trim($value); } return $newdata; }
[Reply to this message]
Copyright © 2005-2006 Powered by Custom PHP Programming