Walks the array while sanitizing the contents.
Parameters
$input_array
arrayrequired- Array to walk while sanitizing contents.
Source
function add_magic_quotes( $input_array ) {
foreach ( (array) $input_array as $k => $v ) {
if ( is_array( $v ) ) {
$input_array[ $k ] = add_magic_quotes( $v );
} elseif ( is_string( $v ) ) {
$input_array[ $k ] = addslashes( $v );
}
}
return $input_array;
}
User Contributed Notes
You must log in before being able to contribute a note or feedback.