Manual:Urlencoding/cs
Urlencoding is required in a number of situations. For example, API tokens need to be urlencoded or they will be rejected as invalid.
Wikitext
URL kód můžete použít k zakódování řetězce z wikitextu pomocí tohoto magického slova :
{{urlencode: VERY LONG EXAMPLE & SOMETHING }}
Výsledek:
VERY+LONG+EXAMPLE+%26+SOMETHING
PHP
Záhlaví nastavení
Typický kód pro nastavení záhlaví, např. pro API:Úpravy , by byl:
curl_setopt( $this->curl, CURLOPT_HTTPHEADER, array( 'Content-Type: application/x-www-form-urlencoded' ) );