前端encodeURIComponent 和后端http_build_query配合

解决特殊字符不能转义

1、

 function fixedEncodeURIComponent (str) {
  return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
    return '%' + c.charCodeAt(0).toString(16);
  });
}
2、
http_build_query($array,'','&',PHP_QUERY_RFC3986);
原文地址:https://www.cnblogs.com/loweringye/p/6016817.html