PHP - urlencode
Trieda
Metóda - urlencode
(PHP 4, PHP 5, PHP 7)
Encodes a string so it can be used as a part of URL.
Beware: If you place a variable named as HTML entity in the
URL, e.g. &amp, the browser will convert this part of the
string to this entity instead!
Procedurálne
- function urlencode (string $str) : string
Parametre
| Názov | Dátový typ | Predvolená hodnota | Popis |
|---|---|---|---|
| $str | string | The string which will be encoded. |
Mávratovej hodnoty
Vracia: string
Returns the encoded string in which all the non-alfanumeric characters and
_ are replaced by the representation of % and a two-character
hexadecimal number. Spaces are replaced with +.
Príklady
<?php
echo urlencode("http://ict.social/?x=1&y=2") . "\n";
Súvisiace manuály
- function urldecode (string $str) : string
