rawurldecode
(PHP 4, PHP 5, PHP 7, PHP 8)
rawurldecode — 對已編碼的 URL 字串進行解碼
說明
rawurldecode(string
$str
): string
返回字串,此字串中百分號(%
)後跟兩位十六進制數的序列都將被替換成原義字元。
參數
-
str
-
要解碼的 URL。
返回值
返回解碼后的 URL 字串。
範例
示例 #1 rawurldecode() 示例
<?php
echo rawurldecode('foo%20bar%40baz'); // foo bar@baz
?>
註釋
注意:
rawurldecode() 不會把加號('+')解碼為空格,而 urldecode() 可以。
參見
- rawurlencode() - 按照 RFC 3986 對 URL 進行編碼
- urldecode() - 解碼已編碼的 URL 字串
- urlencode() - 編碼 URL 字串
- » RFC 3986