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($form data)
{
foreach ($formdata as $key => $value)
{
$value = preg_replace("( \r\n|\n|\r|\t)" , "", $value);
$newdata[trim($key)] = trim($value);
}
return $newdata;
}
character returns from submitted $_POST values. Does this look serviceable?
function trim_data($form data)
{
foreach ($formdata as $key => $value)
{
$value = preg_replace("( \r\n|\n|\r|\t)" , "", $value);
$newdata[trim($key)] = trim($value);
}
return $newdata;
}
Comment