NOVINKA: Najžiadanejšie rekvalifikačné kurzy teraz s 50% zľavou + kurz AI ZADARMO. Nečakaj, táto ponuka dlho nevydrží! Zisti viac:

PHP - urlencode

Trieda

Koreň \ Bez triedy

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

Parametre

NázovDátový typPredvolená hodnotaPopis
$strstring

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

      Aktivity