urlencode

The urlencode operation makes a value safe to put in a URL. Characters that would break the URL, or be read as part of its structure, are turned into percent codes.

How it works

Value: hello world           Result: hello+world
Value: info@example.com      Result: info%40example.com
Value: +420797992279         Result: %2B420797992279
Value: ahoj světe & go       Result: ahoj+sv%C4%9Bte+%26+go

The rules are simple: spaces become +, letters, digits and - _ . ~ stay as they are, and everything else becomes % followed by two hex digits.

Spaces become plus, not %20

Both forms are valid in a query string and most systems accept either. Some do not, and a value that arrives with a literal + where a space should be is the usual symptom.

If the other side needs %20, this operation is not the one you want, and it will need to be handled differently. Check an example from their documentation before assuming.

Where the plus sign bites

A phone number written as +420797992279 encodes to %2B420797992279, which is correct. Left unencoded in a URL, that same + is read as a space, and the number arrives as 420797992279.

This is the single most common reason a phone number breaks in a query parameter, and it is invisible until you look at what actually arrived.

When you need it

Only for values going into a URL, meaning a query parameter or a redirect link you are building yourself.

You do not need it for values in a JSON body, and encoding them there sends the advertiser percent codes instead of text. You do not usually need it for the query fields on an HTTP request node either, since those are encoded when the request is built. Encoding twice turns %40 into %2540, which nobody wants.

So reach for it when you are assembling a URL as a value, not when you are filling in a request.

The other direction

To decode, use urldecode.

Reference

See PHP: urlencode and RFC 3986.

Insights that
helps you grow

  • Release notes 2026/07/31
    What’s new in PalDock? A lot of this month went into things you won’t see directly – query optimisation, indexing, and general tuning under the…
  • Free Affiliate tracking software
    Many companies (inlcuding YOU) search for free affiliate tracking software because they want to launch an affiliate program without committing to expensive monthly fees. The…
  • Release notes 2026/06/30
    We implemented numerous performance improvements and feature enhancements based on your feedback. We also significantly expanded the flexibility of the following features: The External Final Page…