php - 解析编码 $_SERVER ['request_uri' ]

标签 php url request

简单问一下,$_SERVER['request_uri'] 不包含解码后的网址,而是原始网址。如果我访问 http://localhost/asd/%20/ 它包含 asd/%20/。将其解析为 asd// 的函数名称是什么?

最佳答案

您正在寻找urldecode()

Decodes any %## encoding in the given string. Plus symbols ('+') are decoded to a space character.

关于php - 解析编码 $_SERVER ['request_uri' ],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20019475/

相关文章:

php - PDO动态表名设置

php - 将唯一标识符附加到 Laravel 请求

javascript - 从动态元素列表中获取选择器事件索引

url - 无法将 "+"传递给 grails webservice URL

javascript - 后期操作不起作用,需要帮助将信息从 View 传递到 Controller

docker - 使用docker-compose链接到网络中的容器

stream - 如何在 Dart 中从 Http 请求中读取所有二进制文件?

java - 如何在 Java ReSTLet 中访问请求的 header 值?

php - 如何计算 mysql 表中的特定值并用 php 回显,varchar 在表中有多少次?

php - Laravel Eloquent 查询意外结果