array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.urldecode.php', 1 => 'urldecode', ), 'up' => array ( 0 => 'ref.url.php', 1 => 'URL 函数', ), 'prev' => array ( 0 => 'function.rawurlencode.php', 1 => 'rawurlencode', ), 'next' => array ( 0 => 'function.urlencode.php', 1 => 'urlencode', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/url/functions/urldecode.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
urldecode — 解码已编码的 URL 字符串
string
要解码的字符串。
返回解码后的字符串。
示例 #1 urldecode() 示例
<?php
$query = "my=apples&are=green+and+red";
foreach (explode('&', $query) as $chunk) {
$param = explode("=", $chunk);
if ($param) {
printf("Value for parameter \"%s\" is \"%s\"<br/>\n", urldecode($param[0]), urldecode($param[1]));
}
}
?>