add_magic_quotes( array $input_array ): array

In this article

Walks the array while sanitizing the contents.

Parameters

$input_arrayarrayrequired
Array to walk while sanitizing contents.

Return

array Sanitized $input_array.

Source

 * @since 0.71
 * @since 5.5.0 Non-string values are left untouched.
 *
 * @param array $input_array Array to walk while sanitizing contents.
 * @return array Sanitized $input_array.
 */
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 ) ) {

Changelog

VersionDescription
5.5.0Non-string values are left untouched.
0.71Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.