I am using this code and it work well:
function fromuser ($variable)
{
$variable = trim(htmlentities($variable, ENT_QUOTES, 'UTF-8'));
return $variable;
}
$first_name = fromuser ($_POST['first_name']);
echo "<div class='text_field_description' $first_name_error>First Name: </div>
<input name='first_name' type='text' class='text_field' value='$first_name' autocomplete='off'>";
echo "<br/>";
Every time I use $_POST['first_name'] i will also define $first_name. So names will always be the same.
So, basically is there a way I can just do this:
fromuser (first_name);
and function will return processed variable as:
$first_name = $variable;
I hope I explained myself well.
Thanks for input.