douan9541 2014-10-19 06:57
浏览 32
已采纳

两个服务器中的PHP _REQUEST [变量]不同

I have an issue with post data encoding. I'm sending (from my application) data (in UTF8) to the php scrypt and the same data: 1) in local server looks like:

_REQUEST["data"]    {"type": "FeatureCollection"

2) in remote (commercial) server looks like

_REQUEST["data"]    %7B%22type%22:%20%22FeatureCollection%22

Is a setting parameter in PHP or function to bring chars from hexadecimal forms?

  • 写回答

1条回答 默认 最新

  • dtqf81594 2014-10-19 07:12
    关注

    Use URL Decoding.

    $data = urldecode($_REQUEST["data"]);
    

    You can use the UTF-8 decode function along with urldecode,

    $data = utf8_decode(urldecode($_REQUEST["data"]));
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?