【发布时间】:2014-02-01 12:21:10
【问题描述】:
由于转义功能已被弃用,因此我创建了此功能,因为它在我的整个网站中都使用,并且每次都替换它会很乏味。
function escape(text) {
text = text.replace(/'/g, "%27");
return encodeURI(text);
}
这会将This is Ben's bookcase 等字符串更改为This%20is%20Ben%2527s%20Bookcase。
当我尝试在 PHP 中使用 rawurldecode() 对其进行解码时,我最终得到了这个 This is
Ben%27s Bookcase。
如何在 PHP 中进行 urldecode 解码单个刻度?
【问题讨论】:
标签: javascript php decode encode