urldecode__recursive

Description

Takes off url encoding (%20, etc.) from the array or string var.

Syntax

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



Parameter $var

Expected type: Mixed
Description: An array or string that has been url-encoded

Allowed types for $var
Allowed values Description
String A string of url-encoded data
Array An array with keys and/or values that have been url-encoded



Parameter $level

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



Return value

Expected type: Mixed
Description: Returns a url-decoded version of $var (returned type will be the same as $var - it won't return an array if $var is a string and vice-versa)

Possible types
Allowed values Description
String A url-decoded version of $var (if $var is a string)
Array $var with all keys and values (including those in sub-arrays) url-decoded (if $var is a string)


Notes

  • Importantly, does it to keys too!
  • Calls itself recursively if there are any sub arrays.
  • Will not go any further if $level is 26 or higher
Advertisement: