Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要在 javascript 中编码一个 url 并在 php 中解码它。我该怎么做?我尝试在php中使用带有urldecode的encodeURI和encodeURIComponent函数,但它不起作用......
在 Javascript 中编码 URL 应该可以与 encodeURI() 一起工作。看这里:
在 JavaScript 中编码 URL?
在 PHP 中,如果您正在读取的 URL 是通过 GET 参数传递的,则无需对其进行解码。它已经完成了。否则, urldecode() 就是你的答案。
如果您需要更多帮助,您将需要发布更多信息。