Encoding and decoding in Views I have a view that accepts a contexual filter.When I pass a value through contextual filter like view/sometext ,it is passed directly without encoding.I need to encode it in the url and decode it before processing it in the view.How can I achieve this?
In the view's contextual filter, you would need to select 'PHP Code' in the 'Provide a default value'. Then in code you can specify something like:

// get current path
$path = explode('/', current_path());
// make sure the path component exists (replace 1)
if (empty($path[1])) return;
// decode the component (use any function you fancy; replace 1)
return base64_decode($path[1]);


The encoding would happen wherever the link exists. If it is a view, you might need to use a module such as Views PHP in order to rewrite your link.