function urlencode_deep($value) {}

Navigates through an array and encodes the values to be used in a URL.
Uses a callback to pass the value of the array back to the function as a string.


  • array|string $value: The array or string to be encoded.

Return values

returns:The encoded array (or string from the callback).

Source code

function urlencode_deep($value) {

	$value = is_array($value) ? array_map('urlencode_deep', $value) : urlencode($value);

	return $value;



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: