Navigates through an array, object, or scalar, and encodes the values to be used in a URL.
Parameters
$value
mixedrequired- The array or string to be encoded.
Source
function urlencode_deep( $value ) {
return map_deep( $value, 'urlencode' );
}
Changelog
Version | Description |
---|---|
2.2.0 | Introduced. |
Here is an example for string:
Here is an example for array:
Here is a use case for multi word string as url parameter:
Here is a use case for an array multi word string as url parameter:
It’s making spaces between word, if string has space: