要在PHP中解码URL参数,可以使用内置的函数urldecode()。这个函数可以解码经过编码的URL参数。例如:
$url = "https://www.example.com/page.php?name=John%20Doe&age=30";$name = urldecode($_GET['name']);$age = urldecode($_GET['age']);echo $name; // 输出:John Doeecho $age; // 输出:30在上面的例子中,urldecode()函数被用来解码URL参数中的特殊字符,使其可读。


