htmlspecialchars__recursive

Description

Adds entities (", <, >) to the array or string var.

Syntax

mixed htmlspecialchars__recursive (mixed $var[, int $level])



Parameter $var

Expected type: Mixed
Description: A string or array of values to add entities to

Allowed types for $var
Allowed values Description
String A string to add entities to
Array An array of values to add entities to



Parameter $level

Expected type: Integer
Description: What level we're at within the array



Return value

Expected type: Mixed
Description:

Possible types
Allowed values Description
String If $var is a string, it returns the string with entities added
Array If $var is an array, it returns the array with entities recursively added to all values in the array


Notes

  • Importantly, does not affect keys, only values.
  • Calls itself recursively if necessary.
  • Will not go any further than 25 levels deep
Advertisement: