Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / PHP

urldecode()

Decode form-style text by turning plus into a space and percent escapes into bytes. %2B represents an actual plus.

Version: PHP 8.4; repository runtime, production runtime not attested

Syntax

urldecode(string $string): string

Decode form-style text by turning plus into a space and percent escapes into bytes. %2B represents an actual plus. Query parameters supplied by PHP are already decoded, so decoding them again can change a literal plus or a percent escape.

Signature

urldecode(string $string): string

Example output

["a b+c","%2B","+"]

Examples

<?php
echo json_encode([urldecode("a+b%2Bc"),urldecode("%252B"),urldecode(urldecode("%252B"))]);

Result

["a b+c","%2B","+"]

Sources