redrum87
August 9th, 2006, 02:25 AM
How could I express this...
$_POST['first_name'] = addslashes($first_name);
$_POST['last_name'] = addslashes($last_name);
$_POST['email_address'] = addslashes($email_address);
$_POST['username'] = addslashes($username);
$_POST['info'] = addslashes($info);
...like this...
foreach($_POST as $input) {
$_POST['array_key'] = addslashes($input);
}
...where 'array_key' is an element of the $_POST array, without actually having to list out the $_POST array elements one by one. If this could be done, it could be put into a simple function that doesn't require any arguments.
$_POST['first_name'] = addslashes($first_name);
$_POST['last_name'] = addslashes($last_name);
$_POST['email_address'] = addslashes($email_address);
$_POST['username'] = addslashes($username);
$_POST['info'] = addslashes($info);
...like this...
foreach($_POST as $input) {
$_POST['array_key'] = addslashes($input);
}
...where 'array_key' is an element of the $_POST array, without actually having to list out the $_POST array elements one by one. If this could be done, it could be put into a simple function that doesn't require any arguments.